Hi all, who knows how to make evaluation traces (llm evaluator of experiment) fully visible (not only output)? I have this setup, which should log all traces
tracer_provider = register(protocol="http/protobuf", project_name=project_name, auto_instrument=True)💡 Hint: Mention RunLLM in the thread for followups.
evaluation run is itselt a llm invokation, which should be traced, but it shows only output, not full llm call details
yes, I see that project
but inside it, trace consists only of result, without llm invocation details
thanks, let me debug that
Hi John G. what versions of openinference-instrumentation-openai openai arize-phoenix do you have? This sample successfully trace Grok, but not Openai
from openinference.semconv.resource import ResourceAttributes
from opentelemetry import trace
from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter
from opentelemetry.sdk.resources import Resource
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import SimpleSpanProcessor
from phoenix.config import get_env_host, get_env_port
from phoenix.otel import register
tracer_provider = register(protocol="http/protobuf", project_name="test_project", auto_instrument=True)
trace.set_tracer_provider(tracer_provider)
tracer = trace.get_tracer(__name__)
collector_endpoint = f"http://{get_env_host()}:{get_env_port()}/v1/traces"
span_exporter = OTLPSpanExporter(endpoint=collector_endpoint)
simple_span_processor = SimpleSpanProcessor(span_exporter=span_exporter)
trace.get_tracer_provider().add_span_processor(simple_span_processor)
import os
import openai
OPENAI_API_KEY=''
client = openai.OpenAI(api_key=OPENAI_API_KEY)
response = client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": "Write a haiku."}],
)
print(response.choices[0].message.content)
# import os
# from groq import Groq
# GROQ_API_KEY = ""
# client = Groq(
# api_key=GROQ_API_KEY
# )
# chat_completion = client.chat.completions.create(
# messages=[
# {
# "role": "user",
# "content": "Explain the importance of low latency LLMs",
# }
# ],
# model="llama3-70b-8192",
# )
# print(chat_completion.choices[0].message.content)