Closed Granipouss closed 6 months ago
``` import os from literalai import LiteralClient from openai import OpenAI openai_client = OpenAI( api_key=) literal_client = LiteralClient( api_key=) literal_client.instrument_openai() query = "What's 2+2?" messages = [{"role": "user", "content": query}] res = openai_client.chat.completions.create( messages=messages, model="gpt-4", extra_query={ "user-category": "2" }, #extra_body #extra_headers ) print(res) ``` This is important for ppl only using the instrumentation. How do they pass in the user, metadata or tags? Is this possible? Is this also an advantage for having an AI proxy? DoD: * Recommendation on how to tackle this use case.
https://linear.app/chainlit/issue/ENG-1145/openai-instrumentation-with-metadata-and-tags
In the wrapper we have to remove extra arguments because OpenAI throws if we don't.
Documentation incoming...
This change is