-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(graph): passthrough input types to invoke/stream #650
base: main
Are you sure you want to change the base?
Conversation
…e for correct semantics, use Annotation.Root for prebuilt agent executor
> { | ||
declare NodeType: N; | ||
|
||
declare RunInput: RunInput; | ||
declare RunInput: State; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a little strange that RunInput = StateType<SD>
, I think we should change it to Update?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea I agree, this looks to be the other way around, no? input should be update, output should be based on stream mode (sometimes update, sometimes state, etc)
const workflow = new StateGraph<AgentState>({ | ||
channels: schema, | ||
}) | ||
const workflow = new StateGraph(MessagesAnnotation) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is done primarily to get the correct input types (based off the messagesReducer
, but open to different solutions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's good to make this change, the other syntax is deprecated
@@ -3541,6 +3541,7 @@ export function runPregelTests( | |||
hello: "there", | |||
bye: "world", | |||
messages: ["hello"], | |||
// @ts-expect-error This should emit a TS error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can now actually catch excessive keys!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ha nice!
Opting to fix output types in a different PR due to the complexity of
streamMode
Closes #628