Releases: posit-dev/chatlas
Releases · posit-dev/chatlas
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)
chatlas 0.13.0
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()andbatch_chat_completed(). (#177) - The
Chatclass 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 aBaseModelinstance (instead of adict()), leading to a better type hinting/checking experience. (#175) - The
.get_turns()method gains atool_result_roleparameter. Settool_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
chatlas 0.12.0
Breaking changes
ChatAuto()'s first (optional) positional parameter has changed fromsystem_prompttoprovider_model, andsystem_promptis now a keyword parameter. As a result, you may need to changeChatAuto("[system prompt]")->ChatAuto(system_prompt="[system prompt]"). In addition, theproviderandmodelkeyword arguments are now deprecated, but continue to work with a warning, as are the previousCHATLAS_CHAT_PROVIDERandCHATLAS_CHAT_MODELenvironment variables. (#159)
New features
ChatAuto()'s newprovider_modeltakes both provider and model in a single string in the format"{provider}/{model}", e.g."openai/gpt-5". If not provided,ChatAuto()looks for theCHATLAS_CHAT_PROVIDER_MODELenvironment variable, defaulting to"openai"if neither are provided. Unlike previous versions ofChatAuto(), the environment variables are now used only if function arguments are not provided. In other words, ifprovider_modelis given, theCHATLAS_CHAT_PROVIDER_MODELenvironment variable is ignored. Similarly,CHATLAS_CHAT_ARGSare only used if nokwargsare 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: - The
ToolAnnotationstype gains anextrakey 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 asChatCloudflare(),ChatDeepseek(),ChatHuggingFace(), etc. (#159)
chatlas 0.11.1
New features
.register_tool()gains anameparameter (useful for overriding the name of the function). (#162)
Bug fixes
ContentToolRequestis (once again) serializable to/from JSON via Pydantic. (#164).register_tool(model=model)no longer unexpectedly errors whenmodelcontainspydantic.Field(alias='_my_alias'). (#161)
Changes
.register_tool(annotations=annotations)drops support formcp.types.ToolAnnotations()and instead expects a dictionary of the same info. (#164)
chatlas 0.11.0
New features
- The
Chatclass 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 anannotationsparameter, which is useful for describing the tool and its behavior. This information is attached toContentToolRequest()andContentToolResult()(via the.requestparameter) 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
ChatGithub()changed its default forbase_urlfrom https://models.inference.ai.azure.com to https://models.github.ai/inference/. As a result, more models are available (by default). (#155)
chatlas 0.10.0
New features
- Added
ChatCloudflare()for chatting via Cloudflare AI. (#150) - Added
ChatDeepSeek()for chatting via DeepSeek. (#147) - Added
ChatOpenRouter()for chatting via Open Router. (#148) - Added
ChatHuggingFace()for chatting via Hugging Face. (#144) - Added
ChatMistral()for chatting via Mistral AI. (#145) - Added
ChatPortkey()for chatting via Portkey AI. (#143)
Changes
ChatAnthropic()andChatBedrockAnthropic()now default to Claude Sonnet 4.0.
Bug fixes
- Fixed an issue where chatting with some models was leading to
KeyError: 'cached_input'. (#149)