> ## Documentation Index
> Fetch the complete documentation index at: https://docs.galtea.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Inference Result Service

> Inference Result Service API methods in the Galtea SDK

The Inference Result Service in the Galtea SDK allows you to manage [inference results](/concepts/product/version/session/inference-result) for evaluating your products.
This Service is exposed by the `galtea.inference_results` object.

<Info>
  Remember that we will be using the `galtea` object. More information [here](/sdk/api/galtea).
</Info>

## Quick Example

First, initialize the Galtea SDK:

```python theme={"system"}
galtea = Galtea(api_key="YOUR_API_KEY")
```

Generate an inference result using an Agent (recommended):

```python theme={"system"}
# Define your agent function
def my_agent(user_message: str) -> str:
    return f"Response to: {user_message}"


inference_result = galtea.inference_results.generate(agent=my_agent, session=session, input="Generate something")
```

Manually create an inference result:

```python theme={"system"}
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:

```python theme={"system"}
inference_result = galtea.inference_results.update(
    inference_result_id=inference_result_id,
    output="Paris is the capital.",
    cost=0.0001,
)
```

## Service Methods

* [Generate Inference Result](/sdk/api/inference-result/generate) - **Recommended** for automatic trace collection
* [Create Inference Result](/sdk/api/inference-result/create)
* [Create and Evaluate](/sdk/api/inference-result/create-and-evaluate) - Create an inference result and evaluate it in one call
* [Create Inference Result Batch](/sdk/api/inference-result/create-batch)
* [Update Inference Result](/sdk/api/inference-result/update)
* [List Inference Results](/sdk/api/inference-result/list)
* [Get Inference Result](/sdk/api/inference-result/get)
* [Delete Inference Result](/sdk/api/inference-result/delete)

## Related

<Card title="Inference Result" icon="arrow-right-from-bracket" iconType="solid" href="/concepts/product/version/session/inference-result">
  A single turn in a conversation between a user and the AI.
</Card>
