mirror of
https://github.com/enricoros/big-AGI.git
synced 2026-05-10 21:50:14 -07:00
Merge branch 'refs/heads/main-stable'
This commit is contained in:
@@ -83,7 +83,7 @@ export function autoSuggestions(conversationId: string, assistantMessageId: stri
|
||||
|
||||
// Follow-up: Auto-Diagrams
|
||||
if (suggestDiagrams) {
|
||||
void llmChatGenerateOrThrow(funcLLMId, [
|
||||
llmChatGenerateOrThrow(funcLLMId, [
|
||||
{ role: 'system', content: systemMessage.text },
|
||||
{ role: 'user', content: userMessage.text },
|
||||
{ role: 'assistant', content: assistantMessageText },
|
||||
@@ -110,7 +110,8 @@ export function autoSuggestions(conversationId: string, assistantMessageId: stri
|
||||
}
|
||||
}
|
||||
}).catch(err => {
|
||||
console.error('autoSuggestions::diagram:', err);
|
||||
// Likely the model did not support function calling
|
||||
// console.log('autoSuggestions: diagram error:', err);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import { hasGoogleAnalytics } from '~/common/components/GoogleAnalytics';
|
||||
import type { ModelDescriptionSchema } from './server/llm.server.types';
|
||||
import type { OpenAIWire } from './server/openai/openai.wiretypes';
|
||||
import type { StreamingClientUpdate } from './vendors/unifiedStreamingClient';
|
||||
import { DLLM, DLLMId, DModelSource, DModelSourceId, LLM_IF_OAI_Chat, useModelsStore } from './store-llms';
|
||||
import { DLLM, DLLMId, DModelSource, DModelSourceId, LLM_IF_OAI_Chat, LLM_IF_OAI_Fn, useModelsStore } from './store-llms';
|
||||
import { FALLBACK_LLM_TEMPERATURE } from './vendors/openai/openai.vendor';
|
||||
import { findAccessForSourceOrThrow, findVendorForLlmOrThrow } from './vendors/vendors.registry';
|
||||
|
||||
@@ -129,6 +129,10 @@ export async function llmChatGenerateOrThrow<TSourceSetup = unknown, TAccess = u
|
||||
// id to DLLM and vendor
|
||||
const { llm, vendor } = findVendorForLlmOrThrow<TSourceSetup, TAccess, TLLMOptions>(llmId);
|
||||
|
||||
// if the model does not support function calling and we're trying to force a function, throw
|
||||
if (forceFunctionName && !llm.interfaces.includes(LLM_IF_OAI_Fn))
|
||||
throw new Error(`Model ${llmId} does not support function calling`);
|
||||
|
||||
// FIXME: relax the forced cast
|
||||
const options = llm.options as TLLMOptions;
|
||||
|
||||
|
||||
@@ -386,7 +386,7 @@ const _knownMistralChatModels: ManualMappings = [
|
||||
label: 'Codestral (2405)',
|
||||
description: 'Designed and optimized for code generation tasks.',
|
||||
contextWindow: 32768,
|
||||
interfaces: [LLM_IF_OAI_Chat, LLM_IF_OAI_Fn],
|
||||
interfaces: [LLM_IF_OAI_Chat],
|
||||
pricing: { chatIn: 1, chatOut: 3 },
|
||||
},
|
||||
{
|
||||
@@ -397,7 +397,7 @@ const _knownMistralChatModels: ManualMappings = [
|
||||
// copied
|
||||
description: 'Designed and optimized for code generation tasks.',
|
||||
contextWindow: 32768,
|
||||
interfaces: [LLM_IF_OAI_Chat, LLM_IF_OAI_Fn],
|
||||
interfaces: [LLM_IF_OAI_Chat],
|
||||
pricing: { chatIn: 1, chatOut: 3 },
|
||||
},
|
||||
|
||||
@@ -430,7 +430,7 @@ const _knownMistralChatModels: ManualMappings = [
|
||||
label: 'Open Mixtral 8x22B (2404)',
|
||||
description: 'Mixtral 8x22B model',
|
||||
contextWindow: 65536,
|
||||
interfaces: [LLM_IF_OAI_Chat],
|
||||
interfaces: [LLM_IF_OAI_Chat, LLM_IF_OAI_Fn],
|
||||
pricing: { chatIn: 2, chatOut: 6 },
|
||||
},
|
||||
{
|
||||
@@ -441,7 +441,7 @@ const _knownMistralChatModels: ManualMappings = [
|
||||
// copied
|
||||
description: 'Mixtral 8x22B model',
|
||||
contextWindow: 65536,
|
||||
interfaces: [LLM_IF_OAI_Chat],
|
||||
interfaces: [LLM_IF_OAI_Chat, LLM_IF_OAI_Fn],
|
||||
pricing: { chatIn: 2, chatOut: 6 },
|
||||
},
|
||||
// Medium (Deprecated)
|
||||
|
||||
Reference in New Issue
Block a user