What's New
Ollama Chat Completion Client
To use the new Ollama Client:
pip install -U "autogen-ext[ollama]"
from autogen_ext.models.ollama import OllamaChatCompletionClient
from autogen_core.models import UserMessage
ollama_client = OllamaChatCompletionClient(
model="llama3",
)
result = await ollama_client.create([UserMessage(content="What is the capital of France?", source="user")]) # type: ignore
print(result)
To load a client from configuration:
from autogen_core.models import ChatCompletionClient
config = {
"provider": "OllamaChatCompletionClient",
"config": {"model": "llama3"},
}
client = ChatCompletionClient.load_component(config)
It also supports structured output:
from autogen_ext.models.ollama import OllamaChatCompletionClient
from autogen_core.models import UserMessage
from pydantic import BaseModel
class StructuredOutput(BaseModel):
first_name: str
last_name: str
ollama_client = OllamaChatCompletionClient(
model="llama3",
response_format=StructuredOutput,
)
result = await ollama_client.create([UserMessage(content="Who was the first man on the moon?", source="user")]) # type: ignore
print(result)
- Ollama client by @peterychang in #5553
- Fix ollama docstring by @peterychang in #5600
- Ollama client docs by @peterychang in #5605
New Required name
Field in FunctionExecutionResult
Now name
field is required in FunctionExecutionResult
:
exec_result = FunctionExecutionResult(call_id="...", content="...", name="...", is_error=False)
- fix: Update SKChatCompletionAdapter message conversion by @lspinheiro in #5749
Using thought
Field in CreateResult
and ThoughtEvent
Now CreateResult
uses the optional thought
field for the extra text content generated as part of a tool call from model. It is currently supported by OpenAIChatCompletionClient
.
When available, the thought
content will be emitted by AssistantAgent
as a ThoughtEvent
message.
- feat: Add thought process handling in tool calls and expose ThoughtEvent through stream in AgentChat by @ekzhu in #5500
New metadata
Field in AgentChat Message Types
Added a metadata
field for custom message content set by applications.
- Add metadata field to basemessage by @husseinmozannar in #5372
Exception in AgentChat Agents is now fatal
Now, if there is an exception raised within an AgentChat agent such as the AssistantAgent
, instead of silently stopping the team, it will raise the exception.
- fix: Allow background exceptions to be fatal by @jackgerrits in #5716
New Termination Conditions
New termination conditions for better control of agents.
See how you use TextMessageTerminationCondition
to control a single agent team running in a loop: https://microsoft.github.io/autogen/stable/user-guide/agentchat-user-guide/tutorial/teams.html#single-agent-team.
FunctionCallTermination
is also discussed as an example for custom termination condition: https://microsoft.github.io/autogen/stable/user-guide/agentchat-user-guide/tutorial/termination.html#custom-termination-condition
- TextMessageTerminationCondition for agentchat by @EItanya in #5742
- FunctionCallTermination condition by @ekzhu in #5808
Docs Update
The ChainLit sample contains UserProxyAgent
in a team, and shows you how to use it to get user input from UI. See: https://github.com/microsoft/autogen/tree/main/python/samples/agentchat_chainlit
- doc & sample: Update documentation for human-in-the-loop and UserProxyAgent; Add UserProxyAgent to ChainLit sample; by @ekzhu in #5656
- docs: Add logging instructions for AgentChat and enhance core logging guide by @ekzhu in #5655
- doc: Enrich AssistantAgent API documentation with usage examples. by @ekzhu in #5653
- doc: Update SelectorGroupChat doc on how to use O3-mini model. by @ekzhu in #5657
- update human in the loop docs for agentchat by @victordibia in #5720
- doc: update guide for termination condition and tool usage by @ekzhu in #5807
- Add examples for custom model context in AssistantAgent and ChatCompletionContext by @ekzhu in #5810
Bug Fixes
- Initialize BaseGroupChat before reset by @gagb in #5608
- fix: Remove R1 model family from is_openai function by @ekzhu in #5652
- fix: Crash in argument parsing when using Openrouter by @philippHorn in #5667
- Fix: Add support for custom headers in HTTP tool requests by @linznin in #5660
- fix: Structured output with tool calls for OpenAIChatCompletionClient by @ekzhu in #5671
- fix: Allow background exceptions to be fatal by @jackgerrits in #5716
- Fix: Auto-Convert Pydantic and Dataclass Arguments in AutoGen Tool Calls by @mjunaidca in #5737
Other Python Related Changes
- Update website version by @ekzhu in #5561
- doc: fix typo (recpients -> recipients) by @radamson in #5570
- feat: enhance issue templates with detailed guidance by @ekzhu in #5594
- Improve the model mismatch warning msg by @thinkall in #5586
- Fixing grammar issues by @OndeVai in #5537
- Fix typo in doc by @weijen in #5628
- Make ChatCompletionCache support component config by @victordibia in #5658
- DOCS: Minor updates to handoffs.ipynb by @xtophs in #5665
- DOCS: Fixed small errors in the text and made code format more consistent by @xtophs in #5664
- Replace the undefined tools variable with tool_schema parameter in ToolUseAgent class by @shuklaham in #5684
- Improve readme inconsistency by @gagb in #5691
- update versions to 0.4.8 by @ekzhu in #5689
- Update issue templates by @jackgerrits in #5686
- Change base image to one with arm64 support by @jackgerrits in #5681
- REF: replaced variable name in TextMentionTermination by @pengjunfeng11 in #5698
- Refactor AssistantAgent on_message_stream by @lspinheiro in #5642
- Fix accessibility issue 14 for visual accessibility by @peterychang in #5709
- Specify specific UV version should be used by @jackgerrits in #5711
- Update README.md for improved clarity and formatting by @gagb in #5714
- add anthropic native support by @victordibia in #5695
- 5663 ollama client host by @rylativity in #5674
- Fix visual accessibility issues 6 and 20 by @peterychang in #5725
- Add Serialization Instruction for MemoryContent by @victordibia in #5727
- Fix typo by @stuartleeks in #5754
- Add support for default model client, in AGS updates to settings UI by @victordibia in #5763
- fix incorrect field name from config to component by @peterj in #5761
- Make FileSurfer and CodeExecAgent Declarative by @victordibia in #5765
- docs: add note about markdown code block requirement in CodeExecutorA… by @jay-thakur in #5785
- add options to ollama client by @peterychang in #5805
- add stream_options to openai model by @peterj in #5788
- add api docstring to with_requirements by @victordibia in #5746
- Update with correct message types by @laurentran in #5789
- Update installation.md by @LuSrackhall in #5784
- Update magentic-one.md by @Paulhb7 in #5779
- Add ChromaDBVectorMemory in Extensions by @victordibia in #5308
New Contributors
- @radamson made their first contribution in #5570
- @OndeVai made their first contribution in #5537
- @philippHorn made their first contribution in #5667
- @shuklaham made their first contribution in #5684
- @pengjunfeng11 made their first contribution in #5698
- @cedricmendelin made their first contribution in #5422
- @rylativity made their first contribution in #5674
- @stuartleeks made their first contribution in #5754
- @peterj made their first contribution in #5761
- @jay-thakur made their first contribution in #5785
- @YASAI03 made their first contribution in #5794
- @laurentran made their first contribution in #5789
- @mjunaidca made their first contribution in #5737
- @LuSrackhall made their first contribution in #5784
- @Paulhb7 made their first contribution in #5779
Full Changelog: python-v0.4.7...python-v0.4.8