File tree Expand file tree Collapse file tree 2 files changed +33
-4
lines changed
setting/operation_setting
web/src/pages/Setting/Operation Expand file tree Collapse file tree 2 files changed +33
-4
lines changed Original file line number Diff line number Diff line change @@ -33,11 +33,40 @@ type ChannelAffinitySetting struct {
3333}
3434
3535var channelAffinitySetting = ChannelAffinitySetting {
36- Enabled : false ,
36+ Enabled : true ,
3737 SwitchOnSuccess : true ,
3838 MaxEntries : 100_000 ,
3939 DefaultTTLSeconds : 3600 ,
40- Rules : []ChannelAffinityRule {},
40+ Rules : []ChannelAffinityRule {
41+ {
42+ Name : "codex trace" ,
43+ ModelRegex : []string {"^gpt-.*$" },
44+ PathRegex : []string {"/v1/responses" },
45+ KeySources : []ChannelAffinityKeySource {
46+ {Type : "gjson" , Path : "prompt_cache_key" },
47+ },
48+ ValueRegex : "" ,
49+ TTLSeconds : 0 ,
50+ SkipRetryOnFailure : false ,
51+ IncludeUsingGroup : true ,
52+ IncludeRuleName : true ,
53+ UserAgentInclude : nil ,
54+ },
55+ {
56+ Name : "claude code trace" ,
57+ ModelRegex : []string {"^claude-.*$" },
58+ PathRegex : []string {"/v1/messages" },
59+ KeySources : []ChannelAffinityKeySource {
60+ {Type : "gjson" , Path : "metadata.user_id" },
61+ },
62+ ValueRegex : "" ,
63+ TTLSeconds : 0 ,
64+ SkipRetryOnFailure : false ,
65+ IncludeUsingGroup : true ,
66+ IncludeRuleName : true ,
67+ UserAgentInclude : nil ,
68+ },
69+ },
4170}
4271
4372func init () {
Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ const KEY_SOURCE_TYPES = [
6767
6868const RULE_TEMPLATES = {
6969 codex : {
70- name : 'codex优选 ' ,
70+ name : 'codex trace ' ,
7171 model_regex : [ '^gpt-.*$' ] ,
7272 path_regex : [ '/v1/responses' ] ,
7373 key_sources : [ { type : 'gjson' , path : 'prompt_cache_key' } ] ,
@@ -78,7 +78,7 @@ const RULE_TEMPLATES = {
7878 include_rule_name : true ,
7979 } ,
8080 claudeCode : {
81- name : 'claude-code优选 ' ,
81+ name : 'claude-code trace ' ,
8282 model_regex : [ '^claude-.*$' ] ,
8383 path_regex : [ '/v1/messages' ] ,
8484 key_sources : [ { type : 'gjson' , path : 'metadata.user_id' } ] ,
You can’t perform that action at this time.
0 commit comments