You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
In the following examples, I made two OpenAI calls. They will show as separate traces. It would be great if I can programmatically group the two OpenAI calls into single traces, or make one the parent of the other.
Sorry that I am new to Phoenix, this feature might be already supported, but I find nowhere in the documentation to describe this.
importosos.environ['PHOENIX_PROJECT_NAME'] ='my-llm-app'importphoenixaspxfromphoenix.trace.openaiimportOpenAIInstrumentor# Initialize OpenAI auto-instrumentationOpenAIInstrumentor().instrument()
importosfromopenaiimportOpenAI# Initialize an OpenAI clientclient=OpenAI(api_key=os.environ['OPENAI_API_KEY'])
## 1.# Define a conversation with a user messageconversation= [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Hello, can you help me with something?"}
]
# Generate a response from the assistantresponse=client.chat.completions.create(
model="gpt-3.5-turbo",
messages=conversation,
)
# Extract and print the assistant's reply# The traces will be available in the Phoenix App for the above messsagesassistant_reply=response.choices[0].message.contentprint(assistant_reply)
## 2.conversation.append({"role": "assistant", "content": assistant_reply})
conversation.append({"role": "user", "content": "are you a robot?"})
# Generate a response from the assistantresponse=client.chat.completions.create(
model="gpt-3.5-turbo",
messages=conversation,
)
# Extract and print the assistant's reply# The traces will be available in the Phoenix App for the above messsagesassistant_reply=response.choices[0].message.contentprint(assistant_reply)
Describe the solution you'd like
A clear and concise description of what you want to happen.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
In the following examples, I made two OpenAI calls. They will show as separate traces. It would be great if I can programmatically group the two OpenAI calls into single traces, or make one the parent of the other.
Sorry that I am new to Phoenix, this feature might be already supported, but I find nowhere in the documentation to describe this.
Describe the solution you'd like
A clear and concise description of what you want to happen.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: