Skip to content

Releases: posit-dev/chatlas

chatlas 0.15.1

22 Jan 22:51

Choose a tag to compare

New features

  • .stream() and .stream_async() now support a data_model parameter for structured data extraction while streaming. (#262)
  • .to_solver() now supports a data_model parameter for structured data extraction in evals. When provided, the solver uses .chat_structured() instead of .chat() and outputs JSON-serialized data. (#264)

Bug fixes

  • Fixed ContentToolResult with an error not being JSON serializable. When a tool call failed, calling .get_turns() followed by .model_dump_json() would raise a PydanticSerializationError. (#267)

chatlas 0.15.0

06 Jan 15:55

Choose a tag to compare

New features

  • ChatOpenAI(), ChatAnthropic(), and ChatGoogle() gain a new reasoning parameter to easily opt-into, and fully customize, reasoning capabilities. (#202, #260)
    • A new ContentThinking content type was added and captures the "thinking" portion of a reasoning model. (#192)
  • Added "built-in" web search and URL fetch tools tool_web_search() and tool_web_fetch():
    • tool_web_search() is supported by OpenAI, Claude (Anthropic), and Google (Gemini).
    • tool_web_fetch() is supported by Claude (requires beta header) and Google.
    • New content types ContentToolRequestSearch, ContentToolResponseSearch, ContentToolRequestFetch, and ContentToolResponseFetch capture web tool interactions.
  • Added ToolBuiltIn class to assist with specifying provider-specific built-in tools. This enables provider-specific functionality like OpenAI's image generation to be registered and used as tools. Built-in tools pass raw provider definitions directly to the API rather than wrapping Python functions. (#214)
  • ChatOpenAI() and ChatAzureOpenAI() gain a new service_tier parameter to request a specific service tier (e.g., "flex" for slower/cheaper or "priority" for faster/more expensive). (#204)
  • ChatAuto() now accepts "claude" as an alias for "anthropic", reflecting Anthropic's rebranding of developer tools under the Claude name. (#239)

Changes

  • repr() now generally gives the same result as str() for many classes (Chat, Turn, Content, etc). This leads to a more human-readable result (and is closer to the result that gets echoed by .chat()). (#245)
  • The Chat.get_cost() method's options parameter was renamed to include. (#244)
  • When supplying a model to .register_tool(tool_func, model=ToolModel), the defaults for the model must match the tool_func defaults. Previously, if tool_func had defaults, but ToolModel didn't, those defaults would get silently ignored. (#253)

Improvements

  • Chat and Turn now have a _repr_markdown_ method and an overall improved repr() experience. (#245)
  • ChatSnowflake() now sets the application config parameter for partner identification. Defaults to "py_chatlas" but can be overridden via the SF_PARTNER environment variable. (#209)

Bug fixes

  • Fixed structured data extraction with ChatAnthropic() failing for Pydantic models containing nested types (e.g., list[NestedModel]). The issue was that $defs (containing nested type definitions) was incorrectly placed inside the schema, breaking JSON $ref pointer references. (#100)
  • Fixed MCP tools failing with OpenAI providers due to strict mode schema validation. OpenAI's strict mode rejects standard JSON Schema features like format: "uri" and requires all properties in the required array. MCP tools now set strict=false to use standard JSON Schema conventions. (#255)
  • Fixed MCP tools not working with ChatGoogle(). (#257)
  • Tool functions parameters that are typing.Annotated with a pydantic.Field (e.g., def add(x: Annotated[int, Field(description="First number")])) are now handled correctly. (#251)

chatlas 0.14.0

09 Dec 15:53

Choose a tag to compare

  • ChatOpenAI() (and ChatAzureOpenAI()) gain access to latest models, built-in tools, etc. as a result of moving to the new Responses API. (#192)
  • Added new family of functions (parallel_chat(), parallel_chat_text(), and parallel_chat_structured()) for submitting multiple prompts at once with some basic rate limiting toggles. (#188)
  • Tools can now return image or PDF content types, with content_image_file() or content_pdf_file() (#231).
    • As a result, the experimental ContentToolResultImage and ContentToolResultResource were removed since this new support for generally supporting ContentImage and ContentPDF renders those content types redundant.
  • Added support for systematic evaluation via Inspect AI. This includes:
    • A new .export_eval() method for exporting conversation history as an Inspect eval dataset sample. This supports multi-turn conversations, tool calls, images, PDFs, and structured data.
    • A new .to_solver() method for translating chat instances into Inspect solvers that can be used with Inspect's evaluation framework.
    • A new Turn.to_inspect_messages() method for converting turns to Inspect's message format.
    • Comprehensive documentation in the Evals guide.
  • ChatAnthropic() and ChatBedrockAnthropic() gain new cache parameter to control caching. For ChatAnthropic(), it defaults to "5m", which should (on average) reduce the cost of your chats. For ChatBedrockAnthropic(), it defaults to "none", since caching isn't guaranteed to be widely supported (#215)
  • Added rudimentary support for a new ContentThinking type. (#192)

Changes

  • ChatOpenAI() (and ChatAzureOpenAI()) move from OpenAI's Completions API to Responses API. If this happens to break behavior, change ChatOpenAI() -> ChatOpenAICompletions() (or ChatAzureOpenAI() -> ChatAzureOpenAICompletions()). (#192)
  • The Turn class is now a base class with three specialized subclasses: UserTurn, AssistantTurn, and SystemTurn. Use these new classes to construct turns by hand. (#224)
  • The .set_model_params() method no longer accepts kwargs. Instead, use the new chat.kwargs_chat attribute to set chat input parameters that persist across the chat session. (#212)
  • Provider implementations now require an additional .value_tokens() method. Previously, it was assumed that token info was logged and attached to the Turn as part of the .value_turn() method. The logging and attaching is now handled automatically. (#194)

Improvements

  • ChatAnthropic() and ChatBedrockAnthropic() now default to Claude Sonnet 4.5.
  • ChatGroq() now defaults to llama-3.1-8b-instant.
  • Chat.chat(), Chat.stream(), and related methods now automatically complete dangling tool requests when a chat is interrupted during a tool call loop, allowing the conversation to be resumed without causing API errors (#230).
  • content_pdf_file() and content_pdf_url() now include relevant filename information. (#199)

Bug fixes

  • .set_model_params() now works correctly for .*_async() methods. (#198)
  • .chat_structured() results are now included correctly into the multi-turn conversation history. (#203)
  • ChatAnthropic() now drops empty assistant turns to avoid API errors when tools return side-effect only results. (#226)

chatlas 0.13.2

02 Oct 19:13

Choose a tag to compare

Improvements

  • ContentToolResult's .get_model_value() method now calls .to_json(orient="record") (instead of .to_json()) when relevant. As a result, if a tool call returns a Pandas DataFrame (or similar), the model now receives a less confusing (and smaller) JSON format. (#183)

Bug fixes

  • ChatAzureOpenAI() and ChatDatabricks() now work as expected when a OPENAI_API_KEY environment variable isn't present. (#185)

chatlas 0.13.1

18 Sep 18:08

Choose a tag to compare

Bug fixes

  • ChatGithub() once again uses the appropriate base_url when generating reponses (problem introduced in v0.11.0). (#182)

chatlas 0.13.0

10 Sep 21:12

Choose a tag to compare

New features

  • Added support for submitting multiple chats in one batch. With batch submission, results can take up to 24 hours to complete, but in return you pay ~50% less than usual. For more, see the reference for batch_chat(), batch_chat_text(), batch_chat_structured() and batch_chat_completed(). (#177)
  • The Chat class gains new .chat_structured() (and .chat_structured_async()) methods. These methods supersede the now deprecated .extract_data() (and .extract_data_async()). The only difference is that the new methods return a BaseModel instance (instead of a dict()), leading to a better type hinting/checking experience. (#175)
  • The .get_turns() method gains a tool_result_role parameter. Set tool_result_role="assistant" to collect tool result content (plus the surrounding assistant turn contents) into a single assistant turn. This is convenient for display purposes and more generally if you want the tool calling loop to be contained in a single turn. (#179)

Improvements

  • The .app() method now:
    • Enables bookmarking by default (i.e., chat session survives page reload). (#179)
    • Correctly renders pre-existing turns that contain tool calls. (#179)

chatlas 0.12.0

08 Sep 16:53

Choose a tag to compare

Breaking changes

  • ChatAuto()'s first (optional) positional parameter has changed from system_prompt to provider_model, and system_prompt is now a keyword parameter. As a result, you may need to change ChatAuto("[system prompt]") -> ChatAuto(system_prompt="[system prompt]"). In addition, the provider and model keyword arguments are now deprecated, but continue to work with a warning, as are the previous CHATLAS_CHAT_PROVIDER and CHATLAS_CHAT_MODEL environment variables. (#159)

New features

  • ChatAuto()'s new provider_model takes both provider and model in a single string in the format "{provider}/{model}", e.g. "openai/gpt-5". If not provided, ChatAuto() looks for the CHATLAS_CHAT_PROVIDER_MODEL environment variable, defaulting to "openai" if neither are provided. Unlike previous versions of ChatAuto(), the environment variables are now used only if function arguments are not provided. In other words, if provider_model is given, the CHATLAS_CHAT_PROVIDER_MODEL environment variable is ignored. Similarly, CHATLAS_CHAT_ARGS are only used if no kwargs are provided. This improves interactive use cases, makes it easier to introduce application-specific environment variables, and puts more control in the hands of the developer. (#159)
  • The .register_tool() method now:
    • Accepts a Tool instance as input. This is primarily useful for binding things like annotations to the Tool in one place, and registering it in another. (#172)
    • Supports function parameter names that start with an underscore. (#174)
  • The ToolAnnotations type gains an extra key field -- providing a place for providing additional information that other consumers of tool annotations (e.g., shinychat) may make use of.

Bug fixes

  • ChatAuto() now supports recently added providers such as ChatCloudflare(), ChatDeepseek(), ChatHuggingFace(), etc. (#159)

chatlas 0.11.1

29 Aug 14:12

Choose a tag to compare

New features

  • .register_tool() gains a name parameter (useful for overriding the name of the function). (#162)

Bug fixes

  • ContentToolRequest is (once again) serializable to/from JSON via Pydantic. (#164)
  • .register_tool(model=model) no longer unexpectedly errors when model contains pydantic.Field(alias='_my_alias'). (#161)

Changes

  • .register_tool(annotations=annotations) drops support for mcp.types.ToolAnnotations() and instead expects a dictionary of the same info. (#164)

chatlas 0.11.0

27 Aug 14:56

Choose a tag to compare

New features

  • The Chat class gains a new .list_models() method for obtaining a list of model ids/names, pricing info, and more. (#155)
  • Chat's .register_tool() method gains an annotations parameter, which is useful for describing the tool and its behavior. This information is attached to ContentToolRequest() and ContentToolResult() (via the .request parameter) objects when tool calls occur. To include these objects in streaming content, make sure to set .stream(content="all"). (#156)

Improvements

  • Tools registered via MCP (e.g., .register_mcp_tools_http_stream_async()) now automatically pick up on tool annotations. (#156)

Changes

chatlas 0.10.0

19 Aug 17:44

Choose a tag to compare

New features

Changes

  • ChatAnthropic() and ChatBedrockAnthropic() now default to Claude Sonnet 4.0.

Bug fixes

  • Fixed an issue where chatting with some models was leading to KeyError: 'cached_input'. (#149)