Skip to content

Commit 7d62918

Browse files
committed
Merge remote-tracking branch 'upstream/main'
2 parents 3c60c15 + a49177f commit 7d62918

File tree

5 files changed

+76
-0
lines changed

5 files changed

+76
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { INodeParams, INodeCredential } from '../src/Interface'
2+
3+
class WolframAlphaApp implements INodeCredential {
4+
label: string
5+
name: string
6+
version: number
7+
description: string
8+
inputs: INodeParams[]
9+
10+
constructor() {
11+
this.label = 'WolframAlpha App ID'
12+
this.name = 'wolframAlphaAppId'
13+
this.version = 1.0
14+
this.description = 'Get an App Id from <a target="_blank" href="https://developer.wolframalpha.com">Wolfram Alpha Portal</a>'
15+
this.inputs = [
16+
{
17+
label: 'App ID',
18+
name: 'wolframAlphaAppId',
19+
type: 'password'
20+
}
21+
]
22+
}
23+
}
24+
25+
module.exports = { credClass: WolframAlphaApp }

packages/components/models.json

+4
Original file line numberDiff line numberDiff line change
@@ -616,6 +616,10 @@
616616
"label": "gpt-4o-2024-05-13",
617617
"name": "gpt-4o-2024-05-13"
618618
},
619+
{
620+
"label": "o3-mini",
621+
"name": "o3-mini"
622+
},
619623
{
620624
"label": "o1-preview (latest)",
621625
"name": "o1-preview"

packages/components/nodes/chatmodels/ChatOpenAI/ChatOpenAI.ts

+3
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,9 @@ class ChatOpenAI_ChatModels implements INode {
211211
streaming: streaming ?? true
212212
}
213213

214+
if (modelName === 'o3-mini') {
215+
delete obj.temperature
216+
}
214217
if (maxTokens) obj.maxTokens = parseInt(maxTokens, 10)
215218
if (topP) obj.topP = parseFloat(topP)
216219
if (frequencyPenalty) obj.frequencyPenalty = parseFloat(frequencyPenalty)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import { WolframAlphaTool } from '@langchain/community/tools/wolframalpha'
2+
import { ICommonObject, INode, INodeData, INodeParams } from '../../../src/Interface'
3+
import { getBaseClasses, getCredentialData, getCredentialParam } from '../../../src/utils'
4+
5+
class WolframAlpha_Tools implements INode {
6+
label: string
7+
name: string
8+
version: number
9+
description: string
10+
type: string
11+
icon: string
12+
category: string
13+
baseClasses: string[]
14+
credential: INodeParams
15+
inputs: INodeParams[]
16+
17+
constructor() {
18+
this.label = 'WolframAlpha'
19+
this.name = 'wolframAlpha'
20+
this.version = 1.0
21+
this.type = 'WolframAlpha'
22+
this.icon = 'wolframalpha.png'
23+
this.category = 'Tools'
24+
this.description = 'Wrapper around WolframAlpha - a powerful computational knowledge engine'
25+
this.inputs = []
26+
this.credential = {
27+
label: 'Connect Credential',
28+
name: 'credential',
29+
type: 'credential',
30+
credentialNames: ['wolframAlphaAppId']
31+
}
32+
this.baseClasses = [this.type, ...getBaseClasses(WolframAlphaTool)]
33+
}
34+
35+
async init(nodeData: INodeData, _: string, options: ICommonObject): Promise<any> {
36+
const credentialData = await getCredentialData(nodeData.credential ?? '', options)
37+
const wolframAlphaAppId = getCredentialParam('wolframAlphaAppId', credentialData, nodeData)
38+
return new WolframAlphaTool({
39+
appid: wolframAlphaAppId
40+
})
41+
}
42+
}
43+
44+
module.exports = { nodeClass: WolframAlpha_Tools }
Loading

0 commit comments

Comments
 (0)