mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-03 07:57:22 +00:00
Fix GlobalChatProvider parseProviderModel usage
The parseProviderModel function returns { model, provider } but the code
was trying to destructure { providerId, modelId }. Fixed to correctly
use the actual return values and pass the required providers array
parameter to the function.
This commit is contained in:
1 parent
0c4de2e2c0
commit
e23c843ef9
1 file changed
+3
-4
@@ -65,15 +65,14 @@ export function GlobalChatProvider({ children }: GlobalChatProviderProps) {
|
||||
return trimmedMessages;
|
||||
}, []);
|
||||
|
||||
const sendMessage = useCallback(async (content: string, providerModel: string) => {
|
||||
const sendMessage = useCallback(async (content: string, providerModelString: string) => {
|
||||
if (!content.trim() || isLoading) return;
|
||||
|
||||
// Parse provider and model
|
||||
const { providerId, modelId } = parseProviderModel(providerModel);
|
||||
const provider = settings.providers.find(p => p.id === providerId);
|
||||
const { model: modelId, provider } = parseProviderModel(providerModelString, settings.providers);
|
||||
|
||||
if (!provider) {
|
||||
console.error('Provider not found:', providerId);
|
||||
console.error('Provider not found');
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user