Skip to content

Commit

Permalink
1.0.6 - function calling types, use .hbs for prompts
Browse files Browse the repository at this point in the history
  • Loading branch information
nalbion committed Mar 12, 2024
1 parent 96356a5 commit 51989ec
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "agent-adapters",
"version": "1.0.5",
"version": "1.0.6",
"description": "Configurable AI Agents",
"license": "MPL-2.0",
"main": "dist/index.js",
Expand Down
2 changes: 1 addition & 1 deletion src/agents/Agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ export default abstract class Agent {
}

protected getPromptFromFile(promptName: string, context: AgentContext): Promise<string | undefined> {
return getPromptFromFile(path.join(this.promptsDir, promptName + '.txt'), context);
return getPromptFromFile(path.join(this.promptsDir, promptName + '.hbs'), context);
}

/**
Expand Down
22 changes: 17 additions & 5 deletions src/llm/message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,23 @@ export type LlmMessage = {
content: string;
};

export type LlmRequestMessage = {
role: 'system' | 'user' | 'assistant';
content: string;
name?: string;
};
export type LlmRequestMessage =
| {
role: 'system' | 'user' | 'assistant';
content: string;
name?: string;
}
| {
role: 'assistant';
content?: string;
name?: string;
tool_calls: ChatCompletionMessageToolCall[];
}
| {
role: 'tool';
tool_call_id: string;
content: string;
};

export type LlmResponseMessage =
| { role: 'tool'; tools: ChatCompletionMessageToolCall[] }
Expand Down

0 comments on commit 51989ec

Please sign in to comment.