Skip to content

Commit

Permalink
Update index.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
ymefg committed Sep 25, 2024
1 parent caaf206 commit f52d9d4
Showing 1 changed file with 2 additions and 21 deletions.
23 changes: 2 additions & 21 deletions src/libs/agent-runtime/github/index.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,8 @@
import { AgentRuntimeErrorType } from '../error';
import { ChatStreamPayload, ModelProvider, OpenAIChatMessage } from '../types';
import { o1Models, pruneO1Payload } from '../openai';
import { ModelProvider } from '../types';
import { LobeOpenAICompatibleFactory } from '../utils/openaiCompatibleFactory';

// TODO: 临时写法,后续要重构成 model card 展示配置
export const o1Models = new Set([
'o1-preview',
'o1-mini',
]);

export const pruneO1Payload = (payload: ChatStreamPayload) => ({
...payload,
frequency_penalty: 0,
messages: payload.messages.map((message: OpenAIChatMessage) => ({
...message,
role: message.role === 'system' ? 'user' : message.role,
})),
presence_penalty: 0,
stream: false,
temperature: 1,
top_p: 1,
});


export const LobeGithubAI = LobeOpenAICompatibleFactory({
baseURL: 'https://models.inference.ai.azure.com',
chatCompletion: {
Expand Down

0 comments on commit f52d9d4

Please sign in to comment.