Created
August 12, 2024 23:09
-
-
Save elijahbenizzy/82b864a627bfe75ddf90870de5734045 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import openai | |
from opentelemetry import trace | |
tracer = trace.get_tracer("simple_chatbot.example") | |
with tracer.start_as_current_span("query_llm") as span: | |
response = openai.ChatCompletion.create( | |
model="gpt-4", | |
messages=[ | |
{"role": "user", "content": "TODO"} | |
] | |
) | |
result = response["choices"][0]["message"]["content"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment