Skip to content
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

Can't the run_name when running graph #2664

Open
4 tasks done
Daniel-963 opened this issue Dec 6, 2024 · 0 comments
Open
4 tasks done

Can't the run_name when running graph #2664

Daniel-963 opened this issue Dec 6, 2024 · 0 comments

Comments

@Daniel-963
Copy link

Checked other resources

  • This is a bug, not a usage question. For questions, please use GitHub Discussions.
  • I added a clear and detailed title that summarizes the issue.
  • I read what a minimal reproducible example is (https://stackoverflow.com/help/minimal-reproducible-example).
  • I included a self-contained, minimal example that demonstrates the issue INCLUDING all the relevant imports. The code run AS IS to reproduce the issue.

Example Code

# when i def the chatbot using follow code,i cant get the name when run the workflow
async def chatbot1(state: State, config: RunnableConfig):
        config["run_name"] = "chatbot1"
        return {"messages": [await llm1.ainvoke(state["messages"], config)]}

# here i cant get name
async def message_generator(user_input: str):
    """Generate streaming messages from the graph."""
    inputs = [HumanMessage(content=user_input)]

    async for msg, metadata in graph.astream(
        {"messages": inputs}, stream_mode="messages"
    ):
        # here is none.
        # but i can get it when i using second way
        print(msg.name)
        yield json.dumps({"content": msg.content})

# but when using follow code,i can
    async def chatbot1(state: State, config: RunnableConfig):
        RunnableConfig(run_name="chatbot1")
        return {"messages": [await llm1.ainvoke(state["messages"], RunnableConfig(run_name="chatbot1"))]}

# that's why? is it a bug?

Error Message and Stack Trace (if applicable)

it's not a Error ,it's a phenomenon

Description

when i use first way to def the run_name,i cant get name in workflow processing ,but i can get it using seconds code!

System Info

pass

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

No branches or pull requests

1 participant