2024-04-24 08:12:38 +00:00
|
|
|
model: openai:gpt-3.5-turbo # Specify the language model to use
|
|
|
|
temperature: null # Set default temperature parameter
|
|
|
|
top_p: null # Set default top-p parameter
|
2024-04-20 13:07:30 +00:00
|
|
|
save: true # Indicates whether to persist the message
|
|
|
|
save_session: null # Controls the persistence of the session, if null, asking the user
|
|
|
|
highlight: true # Controls syntax highlighting
|
2024-04-28 05:28:24 +00:00
|
|
|
light_theme: false # Activates a light color theme when true. ENV: AICHAT_LIGHT_THEME
|
2024-04-20 13:07:30 +00:00
|
|
|
wrap: no # Controls text wrapping (no, auto, <max-width>)
|
|
|
|
wrap_code: false # Enables or disables wrapping of code blocks
|
|
|
|
keybindings: emacs # Choose keybinding style (emacs, vi)
|
2024-06-11 07:44:35 +00:00
|
|
|
|
|
|
|
prelude: null # Set a default role or session to start with (e.g. role:<name>, session:<name>)
|
|
|
|
repl_prelude: null # This overrides 'prelude' when using REPL
|
2024-04-18 10:22:15 +00:00
|
|
|
|
|
|
|
# Command that will be used to edit the current line buffer with ctrl+o
|
|
|
|
# if unset fallback to $EDITOR and $VISUAL
|
|
|
|
buffer_editor: null
|
2023-10-30 11:52:51 +00:00
|
|
|
|
2024-06-05 01:02:23 +00:00
|
|
|
# Controls the function calling feature. For setup instructions, visit https://github.com/sigoden/llm-functions
|
2024-05-18 11:06:21 +00:00
|
|
|
function_calling: false
|
|
|
|
|
2024-06-11 06:01:45 +00:00
|
|
|
# Regex for seletecting dangerous functions.
|
|
|
|
# User confirmation is required when executing these functions.
|
|
|
|
# e.g. 'execute_command|execute_js_code' 'execute_.*'
|
2024-06-11 23:17:57 +00:00
|
|
|
dangerously_functions_filter: null
|
2024-06-11 06:01:45 +00:00
|
|
|
|
2024-06-11 07:44:35 +00:00
|
|
|
bot_prelude: null # Set a session to use when starting a bot. (e.g. temp, default)
|
|
|
|
|
|
|
|
bots:
|
|
|
|
- name: todo-sh
|
|
|
|
model: null
|
|
|
|
temperature: null
|
|
|
|
top_p: null
|
2024-06-11 23:17:57 +00:00
|
|
|
dangerously_functions_filter: null
|
2024-06-11 07:44:35 +00:00
|
|
|
|
2024-06-05 01:02:23 +00:00
|
|
|
# Specifies the embedding model to use
|
2024-06-14 11:12:18 +00:00
|
|
|
rag_embedding_model: null
|
2024-06-20 22:00:26 +00:00
|
|
|
# Specifies the rerank model to use
|
|
|
|
rag_rerank_model: null
|
2024-06-14 11:12:18 +00:00
|
|
|
# Specifies the chunk size
|
|
|
|
rag_chunk_size: null
|
|
|
|
# Specifies the chunk overlap
|
|
|
|
rag_chunk_overlap: null
|
2024-06-19 04:15:54 +00:00
|
|
|
# Specifies the number of documents to retrieve
|
2024-06-05 01:02:23 +00:00
|
|
|
rag_top_k: 4
|
2024-06-20 23:22:43 +00:00
|
|
|
# Specifies the minimum relevance score for vector-based searching
|
2024-06-20 22:00:26 +00:00
|
|
|
rag_min_score_vector_search: 0
|
2024-06-20 23:22:43 +00:00
|
|
|
# Specifies the minimum relevance score for keyword-based searching
|
|
|
|
rag_min_score_keyword_search: 0
|
2024-06-20 22:00:26 +00:00
|
|
|
# Specifies the minimum relevance score for reranking
|
|
|
|
rag_min_score_rerank: 0
|
2024-06-05 01:02:23 +00:00
|
|
|
|
|
|
|
# Defines the query structure using variables like __CONTEXT__ and __INPUT__ to tailor searches to specific needs
|
|
|
|
rag_template: |
|
2024-06-14 11:12:18 +00:00
|
|
|
Use the following context as your learned knowledge, inside <context></context> XML tags.
|
2024-06-05 01:02:23 +00:00
|
|
|
<context>
|
2024-06-14 11:12:18 +00:00
|
|
|
__CONTEXT__
|
2024-06-05 01:02:23 +00:00
|
|
|
</context>
|
|
|
|
|
2024-06-14 11:12:18 +00:00
|
|
|
When answer to user:
|
|
|
|
- If you don't know, just say that you don't know.
|
|
|
|
- If you don't know when you are not sure, ask for clarification.
|
|
|
|
Avoid mentioning that you obtained the information from the context.
|
|
|
|
And answer according to the language of the user's question.
|
|
|
|
|
|
|
|
Given the context information, answer the query.
|
|
|
|
Query: __INPUT__
|
2024-06-05 01:02:23 +00:00
|
|
|
|
2024-04-20 13:07:30 +00:00
|
|
|
# Compress session when token count reaches or exceeds this threshold (must be at least 1000)
|
2024-05-30 02:19:29 +00:00
|
|
|
compress_threshold: 4000
|
2024-04-20 13:07:30 +00:00
|
|
|
# Text prompt used for creating a concise summary of session message
|
2024-03-04 03:08:59 +00:00
|
|
|
summarize_prompt: 'Summarize the discussion briefly in 200 words or less to use as a prompt for future context.'
|
2024-04-20 13:07:30 +00:00
|
|
|
# Text prompt used for including the summary of the entire session
|
2024-03-04 03:08:59 +00:00
|
|
|
summary_prompt: 'This is a summary of the chat history as a recap: '
|
|
|
|
|
2023-12-24 08:04:18 +00:00
|
|
|
# Custom REPL prompt, see https://github.com/sigoden/aichat/wiki/Custom-REPL-Prompt
|
2024-06-11 03:00:12 +00:00
|
|
|
left_prompt: '{color.green}{?session {?bot {bot}#}{session}{?role /}}{!session {?bot {bot}}}{role}{?rag @{rag}}{color.cyan}{?session )}{!session >}{color.reset} '
|
2023-12-24 08:04:18 +00:00
|
|
|
right_prompt: '{color.purple}{?session {?consume_tokens {consume_tokens}({consume_percent}%)}{!consume_tokens {consume_tokens}}}{color.reset}'
|
|
|
|
|
2023-10-31 08:50:08 +00:00
|
|
|
clients:
|
|
|
|
# All clients have the following configuration:
|
|
|
|
# - type: xxxx
|
2024-04-23 08:46:48 +00:00
|
|
|
# name: xxxx # Only use it to distinguish clients with the same client type. Optional
|
|
|
|
# models:
|
2024-06-05 01:02:23 +00:00
|
|
|
# - name: xxxx
|
2024-04-28 05:28:24 +00:00
|
|
|
# max_input_tokens: 100000
|
|
|
|
# supports_vision: true
|
2024-06-01 02:45:53 +00:00
|
|
|
# supports_function_calling: true
|
2024-06-05 01:02:23 +00:00
|
|
|
# - name: xxxx
|
2024-06-21 13:26:18 +00:00
|
|
|
# type: embedding # Embedding model
|
2024-06-05 01:02:23 +00:00
|
|
|
# max_input_tokens: 2048
|
|
|
|
# default_chunk_size: 2000
|
2024-06-21 13:56:25 +00:00
|
|
|
# max_batch_size: 100
|
2024-06-20 22:00:26 +00:00
|
|
|
# - name: xxxx
|
2024-06-21 13:26:18 +00:00
|
|
|
# type: rerank # Rerank model
|
2024-06-20 22:00:26 +00:00
|
|
|
# max_input_tokens: 2048
|
2024-05-22 13:29:23 +00:00
|
|
|
# patches:
|
|
|
|
# <regex>: # The regex to match model names, e.g. '.*' 'gpt-4o' 'gpt-4o|gpt-4-.*'
|
2024-06-05 01:02:23 +00:00
|
|
|
# chat_completions_body: # The JSON to be merged with the chat completions request body.
|
2023-10-31 08:50:08 +00:00
|
|
|
# extra:
|
2024-05-04 23:04:53 +00:00
|
|
|
# proxy: socks5://127.0.0.1:1080 # Set https/socks5 proxy. ENV: HTTPS_PROXY/https_proxy/ALL_PROXY/all_proxy
|
|
|
|
# connect_timeout: 10 # Set timeout in seconds for connect to api
|
2023-10-31 08:50:08 +00:00
|
|
|
|
2023-10-30 11:52:51 +00:00
|
|
|
# See https://platform.openai.com/docs/quickstart
|
2023-10-31 08:50:08 +00:00
|
|
|
- type: openai
|
2024-04-30 05:15:13 +00:00
|
|
|
api_key: sk-xxx # ENV: {client}_API_KEY
|
|
|
|
api_base: https://api.openai.com/v1 # ENV: {client}_API_BASE
|
2024-04-28 05:28:24 +00:00
|
|
|
organization_id: org-xxx # Optional
|
2023-10-30 11:52:51 +00:00
|
|
|
|
2024-04-30 04:52:58 +00:00
|
|
|
# For any platform compatible with OpenAI's API
|
|
|
|
- type: openai-compatible
|
|
|
|
name: localai
|
2024-04-30 05:15:13 +00:00
|
|
|
api_base: http://localhost:8080/v1 # ENV: {client}_API_BASE
|
|
|
|
api_key: xxx # ENV: {client}_API_KEY
|
2024-04-30 04:52:58 +00:00
|
|
|
chat_endpoint: /chat/completions # Optional
|
|
|
|
models:
|
|
|
|
- name: llama3
|
|
|
|
max_input_tokens: 8192
|
|
|
|
|
2023-12-19 23:49:05 +00:00
|
|
|
# See https://ai.google.dev/docs
|
|
|
|
- type: gemini
|
2024-04-30 05:15:13 +00:00
|
|
|
api_key: xxx # ENV: {client}_API_KEY
|
2024-05-22 13:29:23 +00:00
|
|
|
patches:
|
|
|
|
'.*':
|
2024-06-18 03:27:51 +00:00
|
|
|
chat_completions_body:
|
2024-05-22 13:29:23 +00:00
|
|
|
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
|
2023-10-31 08:50:08 +00:00
|
|
|
|
2024-02-28 00:22:15 +00:00
|
|
|
# See https://docs.anthropic.com/claude/reference/getting-started-with-the-api
|
|
|
|
- type: claude
|
2024-04-30 05:15:13 +00:00
|
|
|
api_key: sk-ant-xxx # ENV: {client}_API_KEY
|
2024-02-28 00:22:15 +00:00
|
|
|
|
2024-04-10 10:52:21 +00:00
|
|
|
# See https://docs.mistral.ai/
|
2024-04-30 04:52:58 +00:00
|
|
|
- type: openai-compatible
|
|
|
|
name: mistral
|
2024-04-30 22:01:10 +00:00
|
|
|
api_base: https://api.mistral.ai/v1
|
2024-04-30 05:15:13 +00:00
|
|
|
api_key: xxx # ENV: {client}_API_KEY
|
2024-02-28 00:22:15 +00:00
|
|
|
|
2024-04-10 10:52:21 +00:00
|
|
|
# See https://docs.cohere.com/docs/the-cohere-platform
|
|
|
|
- type: cohere
|
2024-04-30 05:15:13 +00:00
|
|
|
api_key: xxx # ENV: {client}_API_KEY
|
2024-04-10 10:52:21 +00:00
|
|
|
|
2024-06-18 04:37:25 +00:00
|
|
|
# See https://docs.reka.ai/quick-start
|
|
|
|
- type: reka
|
|
|
|
api_key: xxx # ENV: {client}_API_KEY
|
|
|
|
|
2024-04-25 22:57:23 +00:00
|
|
|
# See https://docs.perplexity.ai/docs/getting-started
|
2024-04-30 22:01:10 +00:00
|
|
|
- type: openai-compatible
|
|
|
|
name: perplexity
|
|
|
|
api_base: https://api.perplexity.ai
|
2024-04-30 05:15:13 +00:00
|
|
|
api_key: pplx-xxx # ENV: {client}_API_KEY
|
2024-04-25 22:57:23 +00:00
|
|
|
|
2024-04-25 12:59:56 +00:00
|
|
|
# See https://console.groq.com/docs/quickstart
|
2024-04-30 22:01:10 +00:00
|
|
|
- type: openai-compatible
|
|
|
|
name: groq
|
|
|
|
api_base: https://api.groq.com/openai/v1
|
2024-04-30 05:15:13 +00:00
|
|
|
api_key: gsk_xxx # ENV: {client}_API_KEY
|
2024-04-25 12:59:56 +00:00
|
|
|
|
2023-12-19 23:49:05 +00:00
|
|
|
# See https://github.com/jmorganca/ollama
|
|
|
|
- type: ollama
|
2024-04-30 05:15:13 +00:00
|
|
|
api_base: http://localhost:11434 # ENV: {client}_API_BASE
|
|
|
|
api_auth: Basic xxx # ENV: {client}_API_AUTH
|
2024-04-28 06:15:10 +00:00
|
|
|
models: # Required
|
2024-04-28 05:28:24 +00:00
|
|
|
- name: llama3
|
2024-03-06 00:35:40 +00:00
|
|
|
max_input_tokens: 8192
|
2024-06-05 01:02:23 +00:00
|
|
|
- name: all-minilm:l6-v2
|
2024-06-21 13:26:18 +00:00
|
|
|
type: embedding
|
2024-06-05 01:02:23 +00:00
|
|
|
max_chunk_size: 1000
|
2023-12-19 23:49:05 +00:00
|
|
|
|
|
|
|
# See https://learn.microsoft.com/en-us/azure/ai-services/openai/chatgpt-quickstart
|
|
|
|
- type: azure-openai
|
2024-04-30 05:15:13 +00:00
|
|
|
api_base: https://{RESOURCE}.openai.azure.com # ENV: {client}_API_BASE
|
|
|
|
api_key: xxx # ENV: {client}_API_KEY
|
2024-04-28 06:15:10 +00:00
|
|
|
models: # Required
|
|
|
|
- name: gpt-35-turbo # Model deployment name
|
2024-03-06 00:35:40 +00:00
|
|
|
max_input_tokens: 8192
|
2023-12-19 12:37:53 +00:00
|
|
|
|
2024-02-28 00:22:15 +00:00
|
|
|
# See https://cloud.google.com/vertex-ai
|
|
|
|
- type: vertexai
|
2024-05-07 08:40:18 +00:00
|
|
|
project_id: xxx # ENV: {client}_PROJECT_ID
|
|
|
|
location: xxx # ENV: {client}_LOCATION
|
2024-04-20 13:07:30 +00:00
|
|
|
# Specifies a application-default-credentials (adc) file, Optional field
|
|
|
|
# Run `gcloud auth application-default login` to init the adc file
|
2024-02-28 00:22:15 +00:00
|
|
|
# see https://cloud.google.com/docs/authentication/external/set-up-adc
|
|
|
|
adc_file: <path-to/gcloud/application_default_credentials.json>
|
2024-05-22 13:29:23 +00:00
|
|
|
patches:
|
|
|
|
'gemini-.*':
|
2024-06-18 03:27:51 +00:00
|
|
|
chat_completions_body:
|
2024-05-22 13:29:23 +00:00
|
|
|
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
|
2024-05-06 00:19:42 +00:00
|
|
|
|
|
|
|
# See https://cloud.google.com/vertex-ai/generative-ai/docs/partner-models/use-claude
|
|
|
|
- type: vertexai-claude
|
2024-05-07 08:40:18 +00:00
|
|
|
project_id: xxx # ENV: {client}_PROJECT_ID
|
|
|
|
location: xxx # ENV: {client}_LOCATION
|
2024-05-06 00:19:42 +00:00
|
|
|
# Specifies a application-default-credentials (adc) file, Optional field
|
|
|
|
# Run `gcloud auth application-default login` to init the adc file
|
|
|
|
# see https://cloud.google.com/docs/authentication/external/set-up-adc
|
|
|
|
adc_file: <path-to/gcloud/application_default_credentials.json>
|
2024-02-28 00:22:15 +00:00
|
|
|
|
2024-04-28 03:27:06 +00:00
|
|
|
# See https://docs.aws.amazon.com/bedrock/latest/userguide/
|
|
|
|
- type: bedrock
|
2024-05-07 08:40:18 +00:00
|
|
|
access_key_id: xxx # ENV: {client}_ACCESS_KEY_ID
|
|
|
|
secret_access_key: xxx # ENV: {client}_SECRET_ACCESS_KEY
|
|
|
|
region: xxx # ENV: {client}_REGION
|
2024-04-28 03:27:06 +00:00
|
|
|
|
2024-04-29 23:07:09 +00:00
|
|
|
# See https://developers.cloudflare.com/workers-ai/
|
|
|
|
- type: cloudflare
|
2024-04-30 05:15:13 +00:00
|
|
|
account_id: xxx # ENV: {client}_ACCOUNT_ID
|
|
|
|
api_key: xxx # ENV: {client}_API_KEY
|
2024-04-29 23:07:09 +00:00
|
|
|
|
|
|
|
# See https://replicate.com/docs
|
|
|
|
- type: replicate
|
2024-04-30 05:15:13 +00:00
|
|
|
api_key: xxx # ENV: {client}_API_KEY
|
2024-04-29 23:07:09 +00:00
|
|
|
|
2023-11-04 00:54:40 +00:00
|
|
|
# See https://cloud.baidu.com/doc/WENXINWORKSHOP/index.html
|
|
|
|
- type: ernie
|
2024-05-07 08:40:18 +00:00
|
|
|
api_key: xxx # ENV: {client}_API_KEY
|
|
|
|
secret_key: xxxx # ENV: {client}_SECRET_KEY
|
2023-11-04 01:51:01 +00:00
|
|
|
|
|
|
|
# See https://help.aliyun.com/zh/dashscope/
|
|
|
|
- type: qianwen
|
2024-05-07 08:40:18 +00:00
|
|
|
api_key: sk-xxx # ENV: {client}_API_KEY
|
2024-04-25 13:19:04 +00:00
|
|
|
|
|
|
|
# See https://platform.moonshot.cn/docs/intro
|
2024-04-30 22:01:10 +00:00
|
|
|
- type: openai-compatible
|
|
|
|
name: moonshot
|
|
|
|
api_base: https://api.moonshot.cn/v1
|
2024-05-07 08:40:18 +00:00
|
|
|
api_key: sk-xxx # ENV: {client}_API_KEY
|
2024-04-29 01:27:11 +00:00
|
|
|
|
2024-05-07 08:16:18 +00:00
|
|
|
# See https://platform.deepseek.com/api-docs/
|
|
|
|
- type: openai-compatible
|
|
|
|
name: deepseek
|
2024-05-07 08:40:18 +00:00
|
|
|
api_key: sk-xxx # ENV: {client}_API_KEY
|
|
|
|
|
|
|
|
# See https://open.bigmodel.cn/dev/howuse/introduction
|
|
|
|
- type: openai-compatible
|
|
|
|
name: zhipuai
|
|
|
|
api_key: xxx # ENV: {client}_API_KEY
|
2024-05-07 08:16:18 +00:00
|
|
|
|
2024-06-18 04:37:25 +00:00
|
|
|
# See https://platform.lingyiwanwu.com/docs
|
|
|
|
- type: openai-compatible
|
|
|
|
name: lingyiwanwu
|
|
|
|
api_key: xxx # ENV: {client}_API_KEY
|
|
|
|
|
2024-04-29 12:08:59 +00:00
|
|
|
# See https://docs.endpoints.anyscale.com/
|
|
|
|
- type: openai-compatible
|
|
|
|
name: anyscale
|
2024-04-30 22:01:10 +00:00
|
|
|
api_base: https://api.endpoints.anyscale.com/v1
|
2024-04-30 05:15:13 +00:00
|
|
|
api_key: xxx # ENV: {client}_API_KEY
|
2024-04-29 12:08:59 +00:00
|
|
|
|
|
|
|
# See https://deepinfra.com/docs
|
|
|
|
- type: openai-compatible
|
|
|
|
name: deepinfra
|
2024-04-30 22:01:10 +00:00
|
|
|
api_base: https://api.deepinfra.com/v1/openai
|
2024-04-30 05:15:13 +00:00
|
|
|
api_key: xxx # ENV: {client}_API_KEY
|
2024-04-29 12:08:59 +00:00
|
|
|
|
|
|
|
# See https://readme.fireworks.ai/docs/quickstart
|
|
|
|
- type: openai-compatible
|
|
|
|
name: fireworks
|
2024-04-30 22:01:10 +00:00
|
|
|
api_base: https://api.fireworks.ai/inference/v1
|
2024-04-30 05:15:13 +00:00
|
|
|
api_key: xxx # ENV: {client}_API_KEY
|
2024-04-29 12:08:59 +00:00
|
|
|
|
2024-04-30 04:52:58 +00:00
|
|
|
# See https://openrouter.ai/docs#quick-start
|
|
|
|
- type: openai-compatible
|
|
|
|
name: openrouter
|
2024-04-30 22:01:10 +00:00
|
|
|
api_base: https://openrouter.ai/api/v1
|
2024-04-30 05:15:13 +00:00
|
|
|
api_key: xxx # ENV: {client}_API_KEY
|
2024-04-29 12:08:59 +00:00
|
|
|
|
|
|
|
# See https://octo.ai/docs/getting-started/quickstart
|
|
|
|
- type: openai-compatible
|
|
|
|
name: octoai
|
2024-04-30 22:01:10 +00:00
|
|
|
api_base: https://text.octoai.run/v1
|
2024-04-30 05:15:13 +00:00
|
|
|
api_key: xxx # ENV: {client}_API_KEY
|
2024-04-29 12:08:59 +00:00
|
|
|
|
|
|
|
# See https://docs.together.ai/docs/quickstart
|
|
|
|
- type: openai-compatible
|
|
|
|
name: together
|
2024-04-30 22:01:10 +00:00
|
|
|
api_base: https://api.together.xyz/v1
|
2024-06-11 03:00:12 +00:00
|
|
|
api_key: xxx # ENV: {client}_API_KEY
|