Chat cwd
This commit is contained in:
@@ -12,11 +12,16 @@ export function modelKey(m: ModelOption): string {
|
||||
|
||||
// Store provider names globally for display
|
||||
let globalProviderNames: Record<string, string> = {};
|
||||
let globalHostHome = '';
|
||||
|
||||
export function getProviderDisplayName(providerId: string): string {
|
||||
return globalProviderNames[providerId] || providerId;
|
||||
}
|
||||
|
||||
export function getHostHome(): string {
|
||||
return globalHostHome;
|
||||
}
|
||||
|
||||
export function usePiModels() {
|
||||
const client = useClient();
|
||||
const { isAuthenticated } = useAuth();
|
||||
@@ -25,7 +30,7 @@ export function usePiModels() {
|
||||
queryKey: ['PI_MODELS'],
|
||||
enabled: isAuthenticated,
|
||||
queryFn: async () => {
|
||||
const data = await client.get<{ models: ModelOption[]; providerNames?: Record<string, string> }>('/pi/models');
|
||||
const data = await client.get<{ models: ModelOption[]; providerNames?: Record<string, string>; hostHome?: string }>('/pi/models');
|
||||
|
||||
console.log('[usePiModels] Fetched models:', {
|
||||
modelCount: data.models.length,
|
||||
@@ -38,6 +43,10 @@ export function usePiModels() {
|
||||
globalProviderNames = data.providerNames;
|
||||
console.log('[usePiModels] Stored provider names:', globalProviderNames);
|
||||
}
|
||||
|
||||
if (data.hostHome) {
|
||||
globalHostHome = data.hostHome;
|
||||
}
|
||||
|
||||
return data.models;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user