mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 17:01:00 +03:00
Feature/update openai version, add reasoning effort param, add o3 mini (#3973)
* update openai version, add reasoning effort param * update azure * add filter for pinecone llamaindex * update graph cypher qa chain
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { AzureOpenAIInput, OpenAI, OpenAIInput } from '@langchain/openai'
|
||||
import { AzureOpenAIInput, AzureOpenAI, OpenAIInput } from '@langchain/openai'
|
||||
import { BaseCache } from '@langchain/core/caches'
|
||||
import { BaseLLMParams } from '@langchain/core/language_models/llms'
|
||||
import { ICommonObject, INode, INodeData, INodeOptionsValue, INodeParams } from '../../../src/Interface'
|
||||
@@ -31,7 +31,7 @@ class AzureOpenAI_LLMs implements INode {
|
||||
this.icon = 'Azure.svg'
|
||||
this.category = 'LLMs'
|
||||
this.description = 'Wrapper around Azure OpenAI large language models'
|
||||
this.baseClasses = [this.type, ...getBaseClasses(OpenAI)]
|
||||
this.baseClasses = [this.type, ...getBaseClasses(AzureOpenAI)]
|
||||
this.credential = {
|
||||
label: 'Connect Credential',
|
||||
name: 'credential',
|
||||
@@ -165,7 +165,7 @@ class AzureOpenAI_LLMs implements INode {
|
||||
if (cache) obj.cache = cache
|
||||
if (basePath) obj.azureOpenAIBasePath = basePath
|
||||
|
||||
const model = new OpenAI(obj)
|
||||
const model = new AzureOpenAI(obj)
|
||||
return model
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { OpenAI, OpenAIInput } from '@langchain/openai'
|
||||
import { ClientOptions, OpenAI, OpenAIInput } from '@langchain/openai'
|
||||
import { BaseCache } from '@langchain/core/caches'
|
||||
import { BaseLLMParams } from '@langchain/core/language_models/llms'
|
||||
import { ICommonObject, INode, INodeData, INodeOptionsValue, INodeParams } from '../../../src/Interface'
|
||||
@@ -153,7 +153,7 @@ class OpenAI_LLMs implements INode {
|
||||
|
||||
const cache = nodeData.inputs?.cache as BaseCache
|
||||
|
||||
const obj: Partial<OpenAIInput> & BaseLLMParams & { openAIApiKey?: string } = {
|
||||
const obj: Partial<OpenAIInput> & BaseLLMParams & { configuration?: ClientOptions } = {
|
||||
temperature: parseFloat(temperature),
|
||||
modelName,
|
||||
openAIApiKey,
|
||||
@@ -179,10 +179,14 @@ class OpenAI_LLMs implements INode {
|
||||
}
|
||||
}
|
||||
|
||||
const model = new OpenAI(obj, {
|
||||
basePath,
|
||||
baseOptions: parsedBaseOptions
|
||||
})
|
||||
if (basePath || parsedBaseOptions) {
|
||||
obj.configuration = {
|
||||
baseURL: basePath,
|
||||
defaultHeaders: parsedBaseOptions
|
||||
}
|
||||
}
|
||||
|
||||
const model = new OpenAI(obj)
|
||||
return model
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user