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

I Get Different Responses in Langgraph Studio vs Running It Locally on VS Code #198

Open
Yogesh-Dubey-Ayesavi opened this issue Nov 29, 2024 · 0 comments

Comments

@Yogesh-Dubey-Ayesavi
Copy link

I have developed a configuration file that dynamically creates assistants and tools when passed to a service. While the same configuration works correctly in Visual Studio Code, I encounter errors when running it in Langgraph Studio.

My Graph

image

My Code

import asyncio
from colorama import Fore
from app.services.langchain_service import LangchainService
from app.utils.constants import sample
from app.utils.logger import setup_logging

setup_logging()


async def print_message(response):
    print(
        Fore.GREEN + f"Assistant: {response.text} Index -> {response.index}",
        flush=True,
    )


langchain_service = LangchainService(
    llm_config=sample.get("llm_config"),
    on_partial_response=print_message,
    assistants=sample.get("assistants"),
)

graph = langchain_service.graph

langchain_service.set_call_sid("1")

if __name__ == "__main__":
    try:

        async def main():
            while True:
                # Get input from the user in the console
                user_input = input(Fore.RED + "You: ")

                # Exit loop if user types 'exit'
                if user_input.lower() == "exit":
                    print("Exiting chat.")
                    break

                # Stream response from langchain service
                await langchain_service.run(user_input, stream_output=True)

        # Run the main event loop
        asyncio.run(main())
    except KeyboardInterrupt:
        print("Exiting chat ...")

When running in VS Code

image

When running in LangGraph Studio

image
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