Skip to main content
The Inference Result Service in the Galtea SDK allows you to manage inference results for evaluating your products. This Service is exposed by the galtea.inference_results object.
Remember that we will be using the galtea object. More information here.

Quick Example

from galtea import Galtea, Agent, AgentInput, AgentResponse

galtea = Galtea(api_key="YOUR_API_KEY")

# Define a simple agent
class MyAgent(Agent):
    def call(self, input: AgentInput) -> AgentResponse:
        return AgentResponse(content="Hello from my agent!")

# Create a session
session = galtea.sessions.create(version_id="YOUR_VERSION_ID")

# Generate inference result with automatic trace collection (recommended)
inference_result = galtea.inference_results.generate(
    agent=MyAgent(),
    session=session,
    user_input="Hello!"
)

# Retrieve the result
retrieved = galtea.inference_results.get(id=inference_result.id)
print(f"Output: {retrieved.actual_output}")
print(f"Latency: {retrieved.latency}ms")

Service Methods

Inference Result

A single turn in a conversation between a user and the AI.