Skip to content

Commit

Permalink
Update function names
Browse files Browse the repository at this point in the history
  • Loading branch information
narengogi committed Jul 11, 2024
1 parent fe36c9b commit 3f814c2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/providers/google-vertex-ai/chatComplete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
GoogleMessageRole,
SYSTEM_INSTRUCTION_DISABLED_MODELS,
transformOpenAIRoleToGoogleRole,
transformToolChoice,
transformToolChoiceForGemini,
} from '../google/chatComplete';
import {
ChatCompletionResponse,
Expand Down Expand Up @@ -260,7 +260,7 @@ export const VertexGoogleChatCompleteConfig: ProviderConfig = {
}
return {
functionCallingConfig: {
mode: transformToolChoice(params.tool_choice),
mode: transformToolChoiceForGemini(params.tool_choice),
allowedFunctionNames,
},
};
Expand Down
4 changes: 2 additions & 2 deletions src/providers/google/chatComplete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export const transformOpenAIRoleToGoogleRole = (

type GoogleToolChoiceType = 'AUTO' | 'ANY' | 'NONE';

export const transformToolChoice = (
export const transformToolChoiceForGemini = (
tool_choice: ToolChoice
): GoogleToolChoiceType | undefined => {
if (typeof tool_choice === 'object' && tool_choice.type === 'function')
Expand Down Expand Up @@ -287,7 +287,7 @@ export const GoogleChatCompleteConfig: ProviderConfig = {
}
return {
functionCallingConfig: {
mode: transformToolChoice(params.tool_choice),
mode: transformToolChoiceForGemini(params.tool_choice),
allowedFunctionNames,
},
};
Expand Down

0 comments on commit 3f814c2

Please sign in to comment.