( t *testing.T, db database.Store, userID uuid.UUID, provider string, apiKey string, centralAPIKeyEnabled bool, allowUserAPIKey bool, allowCentralAPIKeyFallback bool, )
| 575 | } |
| 576 | |
| 577 | func 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 | |
| 604 | func insertInternalChatModelConfigForProvider( |
| 605 | t *testing.T, |
no test coverage detected