Skip to content

Commit 738d6d7

Browse files
authored
feat(tool): update web_search_aichat.sh (#166)
1 parent f5c3071 commit 738d6d7

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

tools/web_search_aichat.sh

+11-4
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,23 @@ set -e
1111
# @env WEB_SEARCH_MODEL! The model for web-searching.
1212
#
1313
# supported aichat models:
14+
# - gemini:gemini-2.0-*
1415
# - vertexai:gemini-*
15-
# - perplexity:*-online
16+
# - perplexity:*
1617
# - ernie:*
17-
# - lingyiwanwu:yi-large-rag
1818
# @env LLM_OUTPUT=/dev/stdout The output path
1919

2020
main() {
2121
client="${WEB_SEARCH_MODEL%%:*}"
22-
if [[ "$client" == "vertexai" ]]; then
23-
export AICHAT_PATCH_VERTEXAI_CHAT_COMPLETIONS='{"gemini-.*":{"body":{"tools":[{"googleSearchRetrieval":{}}]}}}'
22+
if [[ "$client" == "gemini" ]]; then
23+
export AICHAT_PATCH_GEMINI_CHAT_COMPLETIONS='{".*":{"body":{"tools":[{"google_search":{}}]}}}'
24+
elif [[ "$client" == "vertexai" ]]; then
25+
export AICHAT_PATCH_VERTEXAI_CHAT_COMPLETIONS='{
26+
"gemini-1.5-.*":{"body":{"tools":[{"googleSearchRetrieval":{}}]}},
27+
"gemini-2.0-.*":{"body":{"tools":[{"google_search":{}}]}}
28+
}'
29+
elif [[ "$client" == "ernie" ]]; then
30+
export AICHAT_PATCH_ERNIE_CHAT_COMPLETIONS='{".*":{"body":{"web_search":{"enable":true}}}}'
2431
fi
2532
aichat -m "$WEB_SEARCH_MODEL" "$argc_query" >> "$LLM_OUTPUT"
2633
}

0 commit comments

Comments
 (0)