-
Notifications
You must be signed in to change notification settings - Fork 323
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: handle multiple tool calls #224
base: main
Are you sure you want to change the base?
Conversation
Hey, thanks for this PR. I have a feeling this will greatly break with my upcoming #199 messages refactor. I'll keep an eye our on how this affects this PR and maybe can help rebase / merge from main to assist in the new messages layout. |
@0xMochan sure, I will rebase periodically to ease the merge once you merge yours. |
/// Represents a completion response with multiple tool calls | ||
MultipleToolCalls(Vec<ModelChoice>), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is not correct approach, from the model of OpenAI you can have just one message or 1 to many tool calls:
So I propose something like this:
#[derive(Debug)]
pub enum ModelChoice {
/// Represents a completion response as a message
Message(String),
/// Represents a completion response as a tool call of the form
/// `ToolCall(function_name, id, function_params)`.
ToolCalls(OneOrMany<ToolCall>),
}
pub struct ToolCall {
function_name: String,
id: String,
function_params: serde_json::Value)
}
fixes #179
feedback wanted!