-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathconfig.yml
More file actions
63 lines (55 loc) · 1.43 KB
/
Copy pathconfig.yml
File metadata and controls
63 lines (55 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# config.example.yml
server:
port: 8080
providers:
- provider: "openai"
api_url: "https://xxx.xxx.com/v1/chat/completions"
api_key: "xxx"
timeout: 30
is_default: true
models:
- name: "xxx"
weight: 10
max_tokens: 2000
temperature: 0.3
- provider: "ollama"
api_url: "http://localhost:11434/api/chat"
timeout: 30
is_default: false
models:
- name: "llama2"
weight: 5
max_tokens: 2000
temperature: 0.3
- name: "mistral"
weight: 5
max_tokens: 2000
temperature: 0.3
cache:
enabled: true
types: ["memory", "redis"]
# 内存缓存特定配置
memory:
ttl:
value: "permanent" # 1小时 (支持: 30s, 5m, 2h, 1d, 1w, permanent)
max_size: 100000000 # 最多存储1亿条记录
# Redis缓存特定配置
redis:
host: "localhost"
port: 6379
password: ""
db: 0
ttl:
value: "permanent" # 7天 (也可以使用: permanent 表示永久存储)
prompt:
template: "Translate the following {{source_lang}} content to {{target_lang}}: {{input}}"
transapi:
tokens:
- "tr-98584e33-f387-42cc-a467-f02513bd400d"
log:
enabled: true
file_path: "logs/translation.log"
max_size: 100 # 单个文件最大大小,单位:MB
max_age: 30 # 保留天数
max_backups: 10 # 最大备份文件数
queue_size: 10000 # 异步队列大小