File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -176,9 +176,11 @@ const session = await LanguageModel.create({
176176 initialPrompts: [
177177 {
178178 role: " system" ,
179- content: ` You are a helpful assistant. You can use tools to help the user.`
180- }
179+ content: ` You are a helpful assistant. You can use tools to help the user.` ,
180+ },
181181 ],
182+ expectedInputs: [{ type: " text" , languages: [" en" ] }],
183+ expectedOutputs: [{ type: " tool-call" }, { type: " text" , languages: [" en" ] }],
182184 tools: [
183185 {
184186 name: " getWeather" ,
@@ -194,12 +196,14 @@ const session = await LanguageModel.create({
194196 required: [" location" ],
195197 },
196198 async execute ({ location }) {
197- const res = await fetch (" https://weatherapi.example/?location=" + location);
199+ const res = await fetch (
200+ " https://weatherapi.example/?location=" + location,
201+ );
198202 // Returns the result as a JSON string.
199203 return JSON .stringify (await res .json ());
200204 },
201- }
202- ]
205+ },
206+ ],
203207});
204208
205209const result = await session .prompt (" What is the weather in Seattle?" );
You can’t perform that action at this time.
0 commit comments