Skip to content

tests: use send twice in a sequence - #3060

Closed
Eugene Yurtsev (eyurtsev) wants to merge 6 commits into
mainfrom
eugene/test_send
Closed

tests: use send twice in a sequence#3060
Eugene Yurtsev (eyurtsev) wants to merge 6 commits into
mainfrom
eugene/test_send

Conversation

@eyurtsev

Copy link
Copy Markdown
Collaborator

No description provided.

@eyurtsev Eugene Yurtsev (eyurtsev) changed the title tests: use send twice in a row? tests: use send twice in a sequence Jan 16, 2025
return {"best_selected_joke": best_joke}

builder = StateGraph(OverallState)
builder.add_conditional_edges("__start__", generate_jokes, ["generate_joke"])

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fails compilation:

          raise ValueError(f"Found edge starting at unknown node '{source}'")

E ValueError: Found edge starting at unknown node 'generate_joke'

  1. This should probably work
  2. We should've called these "add_routing_node" in retrospect

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But your graph doesn't have a "generate_joke" node? What am I missing?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If i add a node it requires the state to be overall state (and I think forces the reduce step)

def generate_jokes(state: OverallState):
# Distribute the subjects to the generate_joke node
sends = [Send("generate_joke", {"subject": s}) for s in state["subjects"]]
return Command(goto=sends)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one fails as well -- looks like a bug

@eyurtsev
Eugene Yurtsev (eyurtsev) deleted the eugene/test_send branch June 25, 2025 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants