MCPcopy Index your code
hub / github.com/coder/coder / TestChatAdvisorConfig_RoundTripModelConfigID

Function TestChatAdvisorConfig_RoundTripModelConfigID

coderd/exp_chats_test.go:12884–12906  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

12882}
12883
12884func TestChatAdvisorConfig_RoundTripModelConfigID(t *testing.T) {
12885 t.Parallel()
12886
12887 ctx := testutil.Context(t, testutil.WaitLong)
12888 adminClient := newChatClient(t)
12889 coderdtest.CreateFirstUser(t, adminClient.Client)
12890
12891 modelConfig := createChatModelConfig(t, adminClient)
12892
12893 want := codersdk.AdvisorConfig{
12894 Enabled: true,
12895 MaxUsesPerRun: 3,
12896 MaxOutputTokens: 2048,
12897 ModelConfigID: modelConfig.ID,
12898 }
12899
12900 err := adminClient.UpdateChatAdvisorConfig(ctx, want)
12901 require.NoError(t, err)
12902
12903 resp, err := adminClient.GetChatAdvisorConfig(ctx)
12904 require.NoError(t, err)
12905 require.Equal(t, want, resp)
12906}
12907
12908func TestChatAdvisorConfig_InvalidModelConfigID(t *testing.T) {
12909 t.Parallel()

Callers

nothing calls this directly

Calls 7

ContextFunction · 0.92
CreateFirstUserFunction · 0.92
newChatClientFunction · 0.70
createChatModelConfigFunction · 0.70
GetChatAdvisorConfigMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected