2
0

♻️ (mistral) Use new ai sdk Mistral core

This commit is contained in:
Baptiste Arnaud
2024-05-21 16:08:35 +02:00
parent e91fced41d
commit 15b2901f8a
26 changed files with 191 additions and 645 deletions

View File

@ -67,6 +67,8 @@ export const askAssistant = createAction({
{
id: 'fetchAssistants',
fetch: async ({ options, credentials }) => {
if (!credentials?.apiKey) return []
const config = {
apiKey: credentials.apiKey,
baseURL: options.baseUrl,
@ -100,7 +102,8 @@ export const askAssistant = createAction({
{
id: 'fetchAssistantFunctions',
fetch: async ({ options, credentials }) => {
if (!options.assistantId) return []
if (!options.assistantId || !credentials?.apiKey) return []
const config = {
apiKey: credentials.apiKey,
baseURL: options.baseUrl,

View File

@ -46,6 +46,8 @@ export const createChatCompletion = createAction({
id: 'fetchModels',
dependencies: ['baseUrl', 'apiVersion'],
fetch: async ({ credentials, options }) => {
if (!credentials?.apiKey) return []
const baseUrl = options?.baseUrl ?? defaultOpenAIOptions.baseUrl
const config = {
apiKey: credentials.apiKey,

View File

@ -37,6 +37,8 @@ export const createSpeech = createAction({
id: 'fetchSpeechModels',
dependencies: ['baseUrl', 'apiVersion'],
fetch: async ({ credentials, options }) => {
if (!credentials?.apiKey) return []
const baseUrl = options?.baseUrl ?? defaultOpenAIOptions.baseUrl
const config = {
apiKey: credentials.apiKey,

View File

@ -7,8 +7,8 @@
"author": "Baptiste Arnaud",
"license": "ISC",
"dependencies": {
"ai": "3.0.31",
"openai": "4.38.3"
"ai": "3.1.12",
"openai": "4.47.1"
},
"devDependencies": {
"@typebot.io/forge": "workspace:*",