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

DOC: <Issue related to /observability/how_to_guides/monitoring/threads> #607

Open
m0nt3cr1st0 opened this issue Dec 23, 2024 · 0 comments
Open

Comments

@m0nt3cr1st0
Copy link

Hello!

I'm having some issues setting Threads for my project despite following this guide and Add metadata and tags literally.

The issue I am having is that although all the runs from my thread have the same session_id they are not bundled into a Thread. I tried using thread_id but that metadata key has no effect either.

This is how I am setting up the metadata:

@traceable
def chat_completion_request(messages, session_id, functions=None, model="gpt-3.5-turbo"):
    client = wrap_openai(OpenAI(api_key=secrets['OPENAI_APIKEY'],), tracing_extra={"metadata":
                                                                                   {"session_id": session_id}})
    try:
        response = client.chat.completions.create(
            model=model,
            messages=messages,
            functions=functions,
        )
        print(f"Model Response: {response}")

Is there any other condition required for Threads to work? If so, could we include it in the guide?

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