Skip to content

call_assistant errors on _NoEncoding response types #763

Description

@eb8680

The following code errors:

import litellm
import pydantic
from effectful.ops.types import Interpretation
from effectful.handlers.llm import Encodable

litellm.completion(model="gpt-4o-mini", messages=[{"role": "user", "content": "hi"}], response_format=pydantic.create_model("Box", __config__={"extra": "forbid"}, value=Encodable[Interpretation]))

Specifically, it raises:

litellm.exceptions.APIConnectionError: litellm.APIConnectionError: APIConnectionError: OpenAIException - `effectful.ops.types.Interpretation` has no `Encodable` encoding, so a value of it can be sent to the model but not decoded from the model's output. Register one with `TypeToPydanticType.register` if the model needs to produce these.

As a result, call_assistant fails for any response_type that emits _NoEncoding, even when tool calls are required.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions