Skip to content

Commit 34fed0b

Browse files
csg-pr-botCementZhangJun Luo
authored
fix: Backfill the model_name/provider in llm_configs upstreams (#1048)
Co-authored-by: cemeng <cemengzhang@gmail.com> Co-authored-by: Jun Luo <jun.luo@opencsg.com>
1 parent a2cb877 commit 34fed0b

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

builder/store/database/migrations/20260423120000_add_fiedlds_upstreams_routing_policy_llm_configs.up.sql

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ BEGIN
4949
jsonb_strip_nulls(
5050
jsonb_build_object(
5151
'url', trim(api_endpoint),
52+
'model_name', NULLIF(trim(model_name), ''),
53+
'provider', NULLIF(trim(provider), ''),
5254
'weight', 1,
5355
'enabled', true,
5456
'auth_header', NULLIF(trim(auth_header), '')
@@ -62,10 +64,14 @@ BEGIN
6264
ELSE
6365
UPDATE llm_configs
6466
SET upstreams = jsonb_build_array(
65-
jsonb_build_object(
66-
'url', trim(api_endpoint),
67-
'weight', 1,
68-
'enabled', true
67+
jsonb_strip_nulls(
68+
jsonb_build_object(
69+
'url', trim(api_endpoint),
70+
'model_name', NULLIF(trim(model_name), ''),
71+
'provider', NULLIF(trim(provider), ''),
72+
'weight', 1,
73+
'enabled', true
74+
)
6975
)
7076
)
7177
WHERE (

0 commit comments

Comments
 (0)