diff options
| author | sigoden <sigoden@gmail.com> | 2024-07-27 21:33:04 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-27 21:33:04 +0800 |
| commit | f5e8e872b08d2aa9b3c063b0a98c59f842f94ecc (patch) | |
| tree | 6f6a6ce299d7383d290a7015b52ce777566d1e8e /config.example.yaml | |
| parent | adf6716c8436b53854eb55588d258f4326580a4d (diff) | |
| download | aichat-f5e8e872b08d2aa9b3c063b0a98c59f842f94ecc.tar.gz | |
feat: support patching request url, headers and body (#756)
Diffstat (limited to 'config.example.yaml')
| -rw-r--r-- | config.example.yaml | 54 |
1 files changed, 30 insertions, 24 deletions
diff --git a/config.example.yaml b/config.example.yaml index 96b001c..803ace7 100644 --- a/config.example.yaml +++ b/config.example.yaml @@ -96,11 +96,15 @@ clients: # type: reranker # max_input_tokens: 2048 # patch: # Patch api request - # chat_completions_body: + # chat_completions: # Api types, one of chat_completions, embeddings, and rerank # <regex>: # The regex to match model names, e.g. '.*' 'gpt-4o' 'gpt-4o|gpt-4-.*' - # <json> # The JSON to be merged with the chat completions request body. + # url: '' # Patch request url + # body: # Patch request body + # <json> + # headers: # Patch request headers + # <key>: <value> # extra: - # proxy: socks5://127.0.0.1:1080 # Set https/socks5 proxy. ENV: HTTPS_PROXY/https_proxy/ALL_PROXY/all_proxy + # proxy: socks5://127.0.0.1:1080 # Set https/socks5 proxy. ENV: HTTPS_PROXY/ALL_PROXY # connect_timeout: 10 # Set timeout in seconds for connect to api # See https://platform.openai.com/docs/quickstart @@ -123,17 +127,18 @@ clients: - type: gemini api_key: xxx # ENV: {client}_API_KEY patch: - chat_completions_body: - '.*': - safetySettings: - - category: HARM_CATEGORY_HARASSMENT - threshold: BLOCK_NONE - - category: HARM_CATEGORY_HATE_SPEECH - threshold: BLOCK_NONE - - category: HARM_CATEGORY_SEXUALLY_EXPLICIT - threshold: BLOCK_NONE - - category: HARM_CATEGORY_DANGEROUS_CONTENT - threshold: BLOCK_NONE + chat_completions: + '.*': + body: + safetySettings: + - category: HARM_CATEGORY_HARASSMENT + threshold: BLOCK_NONE + - category: HARM_CATEGORY_HATE_SPEECH + threshold: BLOCK_NONE + - category: HARM_CATEGORY_SEXUALLY_EXPLICIT + threshold: BLOCK_NONE + - category: HARM_CATEGORY_DANGEROUS_CONTENT + threshold: BLOCK_NONE # See https://docs.anthropic.com/claude/reference/getting-started-with-the-api - type: claude @@ -189,17 +194,18 @@ clients: # see https://cloud.google.com/docs/authentication/external/set-up-adc adc_file: <path-to/gcloud/application_default_credentials.json> patch: - chat_completions_body: + chat_completions: 'gemini-.*': - safetySettings: - - category: HARM_CATEGORY_HARASSMENT - threshold: BLOCK_ONLY_HIGH - - category: HARM_CATEGORY_HATE_SPEECH - threshold: BLOCK_ONLY_HIGH - - category: HARM_CATEGORY_SEXUALLY_EXPLICIT - threshold: BLOCK_ONLY_HIGH - - category: HARM_CATEGORY_DANGEROUS_CONTENT - threshold: BLOCK_ONLY_HIGH + body: + safetySettings: + - category: HARM_CATEGORY_HARASSMENT + threshold: BLOCK_ONLY_HIGH + - category: HARM_CATEGORY_HATE_SPEECH + threshold: BLOCK_ONLY_HIGH + - category: HARM_CATEGORY_SEXUALLY_EXPLICIT + threshold: BLOCK_ONLY_HIGH + - category: HARM_CATEGORY_DANGEROUS_CONTENT + threshold: BLOCK_ONLY_HIGH # See https://cloud.google.com/vertex-ai/generative-ai/docs/partner-models/use-claude - type: vertexai-claude |
