Releases: posit-dev/chatlas
Releases · posit-dev/chatlas
v0.18.1
Improvements
Content.tagify()implementations (ContentToolRequest,ContentToolResult,ContentThinking) now annotate their return type ashtmltools.Tagifiedand fully tagify their output, complying with htmltools 0.7.0's tightened Tagifiable contract. Embedding these contents inside another.tagify()recursion no longer trips the new boundary check in htmltools 0.7.0. (#311)
Bug fixes
ContentPDFis now exported fromchatlas.types, matching all otherContentsubclasses. (#312)
Full changelog: https://github.com/posit-dev/chatlas/blob/main/CHANGELOG.md
chatlas 0.18.0
New features
- New
StreamControllerclass for cooperative stream cancellation. Pass a controller to.stream()or.stream_async()and callcontroller.cancel()to stop the stream cleanly (e.g., from a Shiny "stop generating" button). The partial response is preserved in conversation history. (#279)
Improvements
ChatAnthropic()andChatBedrockAnthropic()now use Anthropic's native structured outputs API for Claude 4.5+ models, enabling streaming withdata_model. Older models fall back to the tool-based approach. A newstructured_output_modeparameter ("auto","native", or"tool") lets you override the auto-detection. (#263)- When a stream is interrupted (closed early, cancelled, or errors), the accumulated content is now saved as a partial
AssistantTurnso conversation state isn't lost. Partial turns display[interrupted](or the cancellation reason) in theChatrepr and are excluded from token/cost accounting. (#279) ChatBedrockAnthropic()now defaults tocache="5m", enabling prompt caching by default — matchingChatAnthropic()'s behavior. (#308)ChatOpenAI()now warns whenbase_urlpoints to a non-OpenAI host, guiding users toChatOpenAICompletions()for third-party backends like vLLM, Ollama, and LiteLLM. (#285)
Bug fixes
- Fixed thinking content being silently dropped during streaming for completions-based providers (DeepSeek, Groq, OpenRouter, etc.). The streaming path was returning finalized
ContentThinkingobjects instead ofContentThinkingDeltafragments, which theTurnAccumulatordidn't recognize. (#301) - Fixed
model_dump(mode="json")failing onTurns containingbytesfields (e.g.,ContentPDF.data,thought_signatureinContentToolRequest/ContentThinkingextras). Bytes values are now base64-encoded during serialization and decoded on validation, so JSON round-trips work correctly. batch_chat(),batch_chat_text(), andbatch_chat_structured()now correctly returnNonewhenwait=Falseand the job is still incomplete. Previously they returned[], making it impossible to distinguish "all requests failed" from "job not done yet". (#306)ChatDatabricks()(and otherChatOpenAICompletions()providers) no longer fail with HTTP 400 when the conversation history contains empty assistant content, which can occur during tool calling. (#305)
chatlas 0.17.0
New features
ChatOpenAICompletions()(and providers built on it likeChatDeepSeek,ChatOpenRouter, etc.) now extractsreasoning_contentfrom model responses asContentThinkingobjects. A newpreserve_thinkingparameter controls whether reasoning content is sent back to the API in multi-turn conversations; it defaults toFalsebut is set toTrueforChatDeepSeek(required for V4 tool-calling) andChatOpenRouter(recommended for quality). (#295)
Improvements
.stream()and.stream_async()now handle thinking content differently by mode. Withcontent="text", thinking is suppressed entirely. Withcontent="all", thinking fragments are yielded asContentThinkingDeltaobjects with aphaseproperty ("start","body", or"end") that communicates block boundaries to downstream consumers without injecting synthetic strings into the stream. (#299, #297, #294)- Updated default models across all providers to current generation. (#292)
- Updated token pricing data from LiteLLM. (#292)
ChatBedrockAnthropic()gains areasoningparameter for extended thinking, matching the existing parameter onChatAnthropic(). (#286)
Full changelog: https://github.com/posit-dev/chatlas/blob/main/CHANGELOG.md
chatlas 0.16.0
New features
- New
ChatLMStudio()provider for chatting with local models via LM Studio. (#280) - The
.stream()and.stream_async()methods now yieldContentThinkingobjects (instead of plain strings) for thinking/reasoning content whencontent="all". This allows downstream packages like shinychat to provide specific UI for thinking content. (#276) - Built-in tools (
tool_web_search(),tool_web_fetch()) now includedescriptionandannotationsproperties, making their metadata consistent with user-defined tools created byTool(). (#278)
Bug fixes
- Fixed OpenAI streaming crash (
AttributeError: 'NoneType' object has no attribute 'output') caused by a newresponse.rate_limits.updatedevent emitted afterresponse.completed. (#282) - Fixed tool calling with Google thinking models (e.g.,
gemini-3-flash-preview) failing with a 400INVALID_ARGUMENTerror about a missingthought_signature. The signature is now preserved and forwarded in subsequent turns. (#274) - OpenAI's
web_search_callno longer errors on non-search action types likeopen_pageandfind_in_page. (#277)
chatlas 0.15.2
chatlas 0.15.1
New features
.stream()and.stream_async()now support adata_modelparameter for structured data extraction while streaming. (#262).to_solver()now supports adata_modelparameter 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
ContentToolResultwith anerrornot being JSON serializable. When a tool call failed, calling.get_turns()followed by.model_dump_json()would raise aPydanticSerializationError. (#267)
chatlas 0.15.0
New features
ChatOpenAI(),ChatAnthropic(), andChatGoogle()gain a newreasoningparameter to easily opt-into, and fully customize, reasoning capabilities. (#202, #260)- A new
ContentThinkingcontent type was added and captures the "thinking" portion of a reasoning model. (#192)
- A new
- Added "built-in" web search and URL fetch tools
tool_web_search()andtool_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, andContentToolResponseFetchcapture web tool interactions.
- Added
ToolBuiltInclass 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()andChatAzureOpenAI()gain a newservice_tierparameter 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 asstr()for many classes (Chat,Turn,Content, etc). This leads to a more human-readable result (and is closer to the result that getsechoed by.chat()). (#245)- The
Chat.get_cost()method'soptionsparameter was renamed toinclude. (#244) - When supplying a
modelto.register_tool(tool_func, model=ToolModel), the defaults for themodelmust match thetool_funcdefaults. Previously, iftool_funchad defaults, butToolModeldidn't, those defaults would get silently ignored. (#253)
Improvements
ChatandTurnnow have a_repr_markdown_method and an overall improvedrepr()experience. (#245)ChatSnowflake()now sets theapplicationconfig parameter for partner identification. Defaults to"py_chatlas"but can be overridden via theSF_PARTNERenvironment 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$refpointer 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 therequiredarray. MCP tools now setstrict=falseto use standard JSON Schema conventions. (#255) - Fixed MCP tools not working with
ChatGoogle(). (#257) - Tool functions parameters that are
typing.Annotatedwith apydantic.Field(e.g.,def add(x: Annotated[int, Field(description="First number")])) are now handled correctly. (#251)
chatlas 0.14.0
ChatOpenAI()(andChatAzureOpenAI()) 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(), andparallel_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()orcontent_pdf_file()(#231).- As a result, the experimental
ContentToolResultImageandContentToolResultResourcewere removed since this new support for generally supportingContentImageandContentPDFrenders those content types redundant.
- As a result, the experimental
- 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.
- A new
ChatAnthropic()andChatBedrockAnthropic()gain newcacheparameter to control caching. ForChatAnthropic(), it defaults to"5m", which should (on average) reduce the cost of your chats. ForChatBedrockAnthropic(), it defaults to"none", since caching isn't guaranteed to be widely supported (#215)- Added rudimentary support for a new
ContentThinkingtype. (#192)
Changes
ChatOpenAI()(andChatAzureOpenAI()) move from OpenAI's Completions API to Responses API. If this happens to break behavior, changeChatOpenAI()->ChatOpenAICompletions()(orChatAzureOpenAI()->ChatAzureOpenAICompletions()). (#192)- The
Turnclass is now a base class with three specialized subclasses:UserTurn,AssistantTurn, andSystemTurn. Use these new classes to construct turns by hand. (#224) - The
.set_model_params()method no longer acceptskwargs. Instead, use the newchat.kwargs_chatattribute to set chat input parameters that persist across the chat session. (#212) Providerimplementations now require an additional.value_tokens()method. Previously, it was assumed that token info was logged and attached to theTurnas part of the.value_turn()method. The logging and attaching is now handled automatically. (#194)
Improvements
ChatAnthropic()andChatBedrockAnthropic()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()andcontent_pdf_url()now include relevantfilenameinformation. (#199)
Bug fixes
chatlas 0.13.2
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 PandasDataFrame(or similar), the model now receives a less confusing (and smaller) JSON format. (#183)
Bug fixes
ChatAzureOpenAI()andChatDatabricks()now work as expected when aOPENAI_API_KEYenvironment variable isn't present. (#185)
chatlas 0.13.1
Bug fixes
ChatGithub()once again uses the appropriatebase_urlwhen generating reponses (problem introduced in v0.11.0). (#182)