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.
The following code errors:
Specifically, it raises:
As a result,
call_assistantfails for anyresponse_typethat emits_NoEncoding, even when tool calls are required.