Skip to content

Commit

Permalink
added a function calling support? method
Browse files Browse the repository at this point in the history
  • Loading branch information
andthattoo committed Sep 16, 2024
1 parent f36c04f commit 31b6da6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
20 changes: 18 additions & 2 deletions src/program/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,25 @@ pub enum Model {
#[serde(rename = "o1-preview")]
O1Preview,
}
// phi3.5:3.8b

// phi3.5:3.8b-mini-instruct-fp16
impl Model {
pub fn supports_tool_calling(&self) -> bool {
match self {
// OpenAI models that support tool calling
Model::GPT4Turbo | Model::GPT4o | Model::GPT4oMini => true,
// Ollama models that support tool calling
Model::Llama3_1_8B
| Model::Llama3_1_8Bq8
| Model::Llama3_1_8Bf16
| Model::Phi3Medium
| Model::Phi3Medium128k
| Model::Gemma2_9BFp16
| Model::Qwen2_7Bf16
| Model::Qwen2_7B => true,
_ => false,
}
}
}

impl From<Model> for String {
fn from(model: Model) -> Self {
Expand Down
2 changes: 2 additions & 0 deletions tests/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ mod simple_workflow_tests {
SIMPLE_WORKFLOW_PATH,
"How does reiki work?"
);

workflow_test!(simple_o1, Model::O1Mini, SIMPLE_WORKFLOW_PATH);
}

mod insert_workflow_tests {
Expand Down

0 comments on commit 31b6da6

Please sign in to comment.