Skip to content

chatlas 0.15.0

Choose a tag to compare

@cpsievert cpsievert released this 06 Jan 15:55
· 8 commits to main since this release

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)