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

First, initialize the Galtea SDK:
galtea = Galtea(api_key="YOUR_API_KEY")
Generate an inference result using an Agent (recommended):
# Define an Agent to be used for generation
class MyAgent(Agent):
    def call(self, input_data: AgentInput) -> AgentResponse:
        # Implement your agent logic here, using input_data content
        return AgentResponse(content="Generated response")


inference_result = galtea.inference_results.generate(
    agent=MyAgent(), session=session, user_input="Generate something"
)
Manually create an inference result:
inference_result = galtea.inference_results.create(
    session_id=session_id,
    input="What is the capital of France?",
    output="Paris",
    latency=150.5,
)
Update an inference result:
inference_result = galtea.inference_results.update(
    inference_result_id=inference_result_id,
    output="Paris is the capital.",
    cost=0.0001,
)

Service Methods

Inference Result

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