refactor: update web_search_aichat.sh (#136)

This commit is contained in:
sigoden
2024-12-10 12:56:53 +08:00
committed by GitHub
parent 0f0ae607d3
commit 22a87a8753
+2 -8
View File
@@ -11,7 +11,6 @@ set -e
# @env WEB_SEARCH_MODEL! The model for web-searching.
#
# supported aichat models:
# - cohere:*
# - vertexai:gemini-*
# - perplexity:*-online
# - ernie:*
@@ -20,14 +19,9 @@ set -e
main() {
client="${WEB_SEARCH_MODEL%%:*}"
case "$client" in
cohere)
export AICHAT_PATCH_COHERE_CHAT_COMPLETIONS='{".*":{"body":{"connectors":[{"id":"web-search"}]}}}'
;;
vertexai)
if [[ "$client" == "vertexai" ]]; then
export AICHAT_PATCH_VERTEXAI_CHAT_COMPLETIONS='{"gemini-.*":{"body":{"tools":[{"googleSearchRetrieval":{}}]}}}'
;;
esac
fi
aichat -m "$WEB_SEARCH_MODEL" "$argc_query" >> "$LLM_OUTPUT"
}