together-ai-sdk
Version:
A typescript SDK for the Together AI API
49 lines (48 loc) • 1.52 kB
TypeScript
export interface RawTogetherConfig {
/**
* The API key to authenticate the requests.
* No default value is provided, so it is required.
*/
apiKey: string;
/**
* @default 'api.together.xyz'
*/
address?: string;
/**
* @default 'https'
*/
protocol?: 'http' | 'https';
/**
* The endpoint to send the request to.
* No default value is provided, so it is required.
*/
endpoint: string;
/**
* The parameters to pass to the API request.
*/
requestParams?: {};
/**
* The retry cooldowns (milliseconds) to use when retrying the request.
* Only used when the request fails with a 429 or 5XX error.
* Pass an empty array to disable retries.
* @default [1000, 5000, 30000]
*/
retryCooldowns?: number[];
/**
* A custom fetch function to use to send the request.
* Useful for testing, logging, or to use a different fetch implementation.
* This library only uses the following fields from the fetch response:
* - status
* - body [Expecting stream reader]
* - json()
* @default built in fetch
*/
customFetch?: typeof fetch;
}
/**
* A low level client to send requests to the Together API.
* Recommended to use the `togetherClient` instead for users.
* Can be helpful for new features or debugging.
* @param userConfig - the configuration object
*/
export declare const rawTogetherRequest: (userConfig: RawTogetherConfig) => ReturnType<typeof fetch>;