Skip to content

Commit

Permalink
Merge pull request #849 from dcSpark/feature/skip-unsafe
Browse files Browse the repository at this point in the history
skip unsafe tool
  • Loading branch information
nicarq authored Feb 5, 2025
2 parents 0f74161 + 92055e4 commit b995c8c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ impl JobPromptGenerator {
}
}
}
// Skip adding TypeScript unsafe processor tool
// This tool is not supported in Gemini due to undefined function parameters Object
if tool_router_key == "local:::__official_shinkai:::shinkai_typescript_unsafe_processor" {
continue;
}
}
None => {}
}
Expand Down
13 changes: 10 additions & 3 deletions shinkai-libs/shinkai-sqlite/src/embedding_function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ impl EmbeddingFunction {
let model_str = match &self.model_type {
EmbeddingModelType::OllamaTextEmbeddingsInference(model) => model.to_string(),
_ => {
println!("Unsupported embedding model type: {:?}", self.model_type);
return Err(rusqlite::Error::InvalidQuery);
}
};
Expand Down Expand Up @@ -55,11 +56,17 @@ impl EmbeddingFunction {
.json(&request_body)
.send()
.await
.map_err(|_e| rusqlite::Error::InvalidQuery)?
.map_err(|e| {
println!("Failed to send request to embedding API: {}", e);
rusqlite::Error::InvalidQuery
})?
.json::<OllamaResponse>()
.await
.map_err(|_e| rusqlite::Error::InvalidQuery)?;
.map_err(|e| {
println!("Failed to parse embedding API response: {}", e);
rusqlite::Error::InvalidQuery
})?;

Ok(response.embedding)
}
}
}

0 comments on commit b995c8c

Please sign in to comment.