Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/globals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ export const ORACLE: string = 'oracle';
export const IO_INTELLIGENCE: string = 'iointelligence';
export const AIBADGR: string = 'aibadgr';
export const OVHCLOUD: string = 'ovhcloud';
export const MIXLAYER: string = 'mixlayer';

export const VALID_PROVIDERS = [
ANTHROPIC,
Expand Down Expand Up @@ -189,6 +190,7 @@ export const VALID_PROVIDERS = [
IO_INTELLIGENCE,
AIBADGR,
OVHCLOUD,
MIXLAYER,
];

export const CONTENT_TYPES = {
Expand Down
2 changes: 2 additions & 0 deletions src/providers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ import OracleConfig from './oracle';
import IOIntelligenceConfig from './iointelligence';
import AIBadgrConfig from './aibadgr';
import OVHcloudConfig from './ovhcloud';
import { mixlayerProviderAPIConfig } from './mixlayer';

const Providers: { [key: string]: ProviderConfigs } = {
openai: OpenAIConfig,
Expand Down Expand Up @@ -148,6 +149,7 @@ const Providers: { [key: string]: ProviderConfigs } = {
iointelligence: IOIntelligenceConfig,
aibadgr: AIBadgrConfig,
ovhcloud: OVHcloudConfig,
mixlayer: mixlayerProviderAPIConfig,
};

export default Providers;
18 changes: 18 additions & 0 deletions src/providers/mixlayer/api.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { ProviderAPIConfig } from '../types';

export const mixlayerAPIConfig: ProviderAPIConfig = {
getBaseURL: () => 'https://models.mixlayer.ai/v1',
headers: ({ providerOptions }) => {
return {
Authorization: `Bearer ${providerOptions.apiKey}`,
};
},
getEndpoint: ({ fn }) => {
switch (fn) {
case 'chatComplete':
return '/chat/completions';
default:
return '';
}
},
};
18 changes: 18 additions & 0 deletions src/providers/mixlayer/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { MIXLAYER } from '../../globals';
import { chatCompleteParams, responseTransformers } from '../open-ai-base';
import { ProviderConfigs } from '../types';
import { mixlayerAPIConfig } from './api';

export const mixlayerProviderAPIConfig: ProviderConfigs = {
chatComplete: chatCompleteParams([
'n',
'logit_bias',
'logprobs',
'top_logprobs',
'user',
]),
api: mixlayerAPIConfig,
responseTransforms: responseTransformers(MIXLAYER, {
chatComplete: true,
}),
};