refactor: update web_search_aichat.sh (#136)
This commit is contained in:
@@ -11,7 +11,6 @@ set -e
|
|||||||
# @env WEB_SEARCH_MODEL! The model for web-searching.
|
# @env WEB_SEARCH_MODEL! The model for web-searching.
|
||||||
#
|
#
|
||||||
# supported aichat models:
|
# supported aichat models:
|
||||||
# - cohere:*
|
|
||||||
# - vertexai:gemini-*
|
# - vertexai:gemini-*
|
||||||
# - perplexity:*-online
|
# - perplexity:*-online
|
||||||
# - ernie:*
|
# - ernie:*
|
||||||
@@ -20,14 +19,9 @@ set -e
|
|||||||
|
|
||||||
main() {
|
main() {
|
||||||
client="${WEB_SEARCH_MODEL%%:*}"
|
client="${WEB_SEARCH_MODEL%%:*}"
|
||||||
case "$client" in
|
if [[ "$client" == "vertexai" ]]; then
|
||||||
cohere)
|
|
||||||
export AICHAT_PATCH_COHERE_CHAT_COMPLETIONS='{".*":{"body":{"connectors":[{"id":"web-search"}]}}}'
|
|
||||||
;;
|
|
||||||
vertexai)
|
|
||||||
export AICHAT_PATCH_VERTEXAI_CHAT_COMPLETIONS='{"gemini-.*":{"body":{"tools":[{"googleSearchRetrieval":{}}]}}}'
|
export AICHAT_PATCH_VERTEXAI_CHAT_COMPLETIONS='{"gemini-.*":{"body":{"tools":[{"googleSearchRetrieval":{}}]}}}'
|
||||||
;;
|
fi
|
||||||
esac
|
|
||||||
aichat -m "$WEB_SEARCH_MODEL" "$argc_query" >> "$LLM_OUTPUT"
|
aichat -m "$WEB_SEARCH_MODEL" "$argc_query" >> "$LLM_OUTPUT"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user