Skip to content

Commit

Permalink
Deepseek: fix assistant message alternation
Browse files Browse the repository at this point in the history
  • Loading branch information
enricoros committed Jan 29, 2025
1 parent d5e0a3e commit 966c402
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ type TRequestMessages = TRequest['messages'];
export function aixToOpenAIChatCompletions(openAIDialect: OpenAIDialects, model: AixAPI_Model, chatGenerate: AixAPIChatGenerate_Request, jsonOutput: boolean, streaming: boolean): TRequest {

// Dialect incompatibilities -> Hotfixes
const hotFixAlternateUserAssistantRoles = openAIDialect === 'perplexity';
const hotFixAlternateUserAssistantRoles = openAIDialect === 'deepseek' || openAIDialect === 'perplexity';
const hotFixRemoveEmptyMessages = openAIDialect === 'perplexity';
const hotFixRemoveStreamOptions = openAIDialect === 'azure' || openAIDialect === 'mistral';
const hotFixSquashMultiPartText = openAIDialect === 'deepseek';
Expand Down Expand Up @@ -127,8 +127,8 @@ function _fixAlternateUserAssistantRoles(chatMessages: TRequestMessages): TReque
// treat intermediate system messages as user messages
if (acc.length > 0 && historyItem.role === 'system') {
historyItem = {
...historyItem,
role: 'user',
content: historyItem.content,
};
}

Expand Down

0 comments on commit 966c402

Please sign in to comment.