Skip to content

Commit

Permalink
fix: by comment about added 'tool' role in messageType
Browse files Browse the repository at this point in the history
  • Loading branch information
erik-balfe committed Dec 13, 2024
1 parent b56a433 commit e4ea830
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/core/src/llms/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export interface LLM<
): Promise<CompletionResponse>;
}

export type MessageType = "user" | "assistant" | "system" | "memory" | "tool";
export type MessageType = "user" | "assistant" | "system" | "memory";

export type TextChatMessage<AdditionalMessageOptions extends object = object> =
{
Expand Down
1 change: 0 additions & 1 deletion packages/llamaindex/src/llm/gemini/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@ export class GeminiHelper {
system: "user",
assistant: "model",
memory: "user",
tool: "user",
};

public static readonly ROLES_FROM_GEMINI: Record<
Expand Down
2 changes: 1 addition & 1 deletion packages/llamaindex/tests/llm/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ describe("Message Formatting", () => {
],
},
{
role: "user",
role: "user", // anthropic considers all that comes not from their inference API is user role
content: [
{
type: "tool_result",
Expand Down

0 comments on commit e4ea830

Please sign in to comment.