Releases: posit-dev/chatlas
Releases · posit-dev/chatlas
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)
chatlas 0.9.2
chatlas 0.9.1
chatlas 0.9.0
New features
Chatgains a handful of new methods:.register_mcp_tools_http_stream_async()and.register_mcp_tools_stdio_async(): for registering tools from a MCP server. (#39).get_tools()and.set_tools(): for fine-grained control over registered tools. (#39).set_model_params(): for setting common LLM parameters in a model-agnostic fashion. (#127).get_cost(): to get the estimated cost of the chat. Only popular models are supported, but you can also supply your own token prices. (#106).add_turn(): to addTurn(s) to the current chat history. (#126)
- Tool functions passed to
.register_tool()can nowyieldnumerous results. (#39) - A
ContentToolResultImagecontent class was added for returning images from tools. It is currently only works withChatAnthropic. (#39) - A
Toolcan now be constructed from a pre-existing tool schema (via a new__init__method). (#39) - The
Chat.app()method gains ahostparameter. (#122) ChatGithub()now supports the more standardGITHUB_TOKENenvironment variable for storing the API key. (#123)
Changes
Breaking Changes
Chatconstructors (ChatOpenAI(),ChatAnthropic(), etc) no longer have aturnskeyword parameter. Use the.set_turns()method instead to set the (initial) chat history. (#126)Chat's.tokens()methods have been removed in favor of.get_tokens()which returns both cumulative tokens in the turn and discrete tokens. (#106)
Other Changes
Tool's constructor no longer takes a function as input. Use the new.from_func()method instead to create aToolfrom a function. (#39).register_tool()now throws an exception when the tool has the same name as an already registered tool. Set the newforceparameter toTrueto force the registration. (#39)
Improvements
ChatGoogle()andChatVertex()now default to Gemini 2.5 (instead of 2.0). (#125)ChatOpenAI()andChatGithub()now default to GPT 4.1 (instead of 4o). (#115)ChatAnthropic()now supportscontent_image_url(). (#112)- HTML styling improvements for
ContentToolResultandContentToolRequest. (#39) Chat's representation now includes cost information if it can be calculated. (#106)token_usage()includes cost if it can be calculated. (#106)
Bug fixes
- Fixed an issue where
httpxclient customization (e.g.,ChatOpenAI(kwargs = {"http_client": httpx.Client()})) wasn't working as expected (#108)
Developer APIs
- The base
Providerclass now includes anameandmodelproperty. In order for them to work properly, provider implementations should pass anameandmodelalong to the__init__()method. (#106) Providerimplementations must implement two new abstract methods:translate_model_params()andsupported_model_params().