feat: update types

This commit is contained in:
Tat Dat Duong
2025-03-05 15:09:10 +01:00
parent 3ee8afce9b
commit 571a170a92
6 changed files with 12 additions and 12 deletions

View File

@@ -1,4 +1,4 @@
import { StockbrokerState } from "../types";
import { StockbrokerState, StockbrokerUpdate } from "../types";
import { ChatOpenAI } from "@langchain/openai";
import { typedUi } from "@langchain/langgraph-sdk/react-ui/server";
import type ComponentMap from "../../uis/index";
@@ -32,7 +32,7 @@ const STOCKBROKER_TOOLS = [
export async function callTools(
state: StockbrokerState,
config: LangGraphRunnableConfig,
): Promise<Partial<StockbrokerState>> {
): Promise<StockbrokerUpdate> {
const ui = typedUi<typeof ComponentMap>(config);
const message = await llm.bindTools(STOCKBROKER_TOOLS).invoke([
@@ -65,8 +65,7 @@ export async function callTools(
return {
messages: [message],
// TODO: Fix the ui return type.
ui: ui.collect as any[],
ui: ui.collect,
timestamp: Date.now(),
};
}