Dolor D Prince
deploy: dolor3v gateway v1.0
c7052c4
Raw
History Blame Contribute Delete
604 Bytes
import { ProviderAPIConfig } from '../types';
const DEFAULT_COMETAPI_BASE_URL = 'https://api.cometapi.com/v1';
const CometAPIAPIConfig: ProviderAPIConfig = {
getBaseURL: () => DEFAULT_COMETAPI_BASE_URL,
headers: ({ providerOptions }) => {
return {
Authorization: `Bearer ${providerOptions.apiKey}`,
};
},
getEndpoint: ({ fn }) => {
switch (fn) {
case 'chatComplete':
case 'stream-chatComplete':
return '/chat/completions';
case 'embed':
return '/embeddings';
default:
return '';
}
},
};
export default CometAPIAPIConfig;