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

Function insertInternalChatProvider

coderd/x/chatd/subagent_internal_test.go:577–602  ·  view source on GitHub ↗
(
	t *testing.T,
	db database.Store,
	userID uuid.UUID,
	provider string,
	apiKey string,
	centralAPIKeyEnabled bool,
	allowUserAPIKey bool,
	allowCentralAPIKeyFallback bool,
)

Source from the content-addressed store, hash-verified

575}
576
577func insertInternalChatProvider(
578 t *testing.T,
579 db database.Store,
580 userID uuid.UUID,
581 provider string,
582 apiKey string,
583 centralAPIKeyEnabled bool,
584 allowUserAPIKey bool,
585 allowCentralAPIKeyFallback bool,
586) database.AIProvider {
587 t.Helper()
588
589 providerConfig := dbgen.AIProvider(t, db, database.AIProvider{
590 Type: database.AIProviderType(provider),
591 Name: "test-" + uuid.NewString(),
592 DisplayName: sql.NullString{String: provider, Valid: true},
593 })
594 if apiKey != "" {
595 dbgen.AIProviderKey(t, db, database.AIProviderKey{
596 ProviderID: providerConfig.ID,
597 APIKey: apiKey,
598 })
599 }
600
601 return providerConfig
602}
603
604func insertInternalChatModelConfigForProvider(
605 t *testing.T,

Calls 4

AIProviderFunction · 0.92
AIProviderTypeTypeAlias · 0.92
AIProviderKeyFunction · 0.92
HelperMethod · 0.65

Tested by

no test coverage detected