feat: allow multiple API keys (#186)

* feat: allow multiple API keys

* chore: cleanup

* chore: upgrade pipecat

* feat: make default api_key as list
This commit is contained in:
Abhishek 2026-03-10 15:17:40 +05:30 committed by GitHub
parent 162bfabac3
commit 57e8768e0b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 174 additions and 137 deletions

View file

@ -10,24 +10,6 @@ import type { AuthUser } from '@/lib/auth';
import { useAuth } from '@/lib/auth';
export type SaveUserConfigFunctionParams = {
llm?: {
[key: string]: string | number;
} | null;
tts?: {
[key: string]: string | number;
} | null;
stt?: {
[key: string]: string | number;
} | null;
embeddings?: {
[key: string]: string | number;
} | null;
test_phone_number?: string | null;
timezone?: string | null;
};
interface TeamPermission {
id: string;
}
@ -40,7 +22,7 @@ interface OrganizationPricing {
interface UserConfigContextType {
userConfig: UserConfigurationRequestResponseSchema | null;
saveUserConfig: (userConfig: SaveUserConfigFunctionParams) => Promise<void>;
saveUserConfig: (userConfig: UserConfigurationRequestResponseSchema) => Promise<void>;
loading: boolean;
error: Error | null;
refreshConfig: () => Promise<void>;
@ -139,7 +121,7 @@ export function UserConfigProvider({ children }: { children: ReactNode }) {
fetchUserConfig();
}, [auth.loading, auth.isAuthenticated]);
const saveUserConfig = useCallback(async (userConfigRequest: SaveUserConfigFunctionParams) => {
const saveUserConfig = useCallback(async (userConfigRequest: UserConfigurationRequestResponseSchema) => {
if (!authRef.current.isAuthenticated) throw new Error('No authentication available');
const response = await updateUserConfigurationsApiV1UserConfigurationsUserPut({
body: {