Skip to content

Commit

Permalink
Merge branch 'main' into stream_token_0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
jspv committed Dec 29, 2024
2 parents 58a322a + 23dbb6a commit f5a14c6
Show file tree
Hide file tree
Showing 73 changed files with 1,972 additions and 1,479 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v3
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- uses: actions/setup-python@v5
Expand All @@ -33,7 +33,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v3
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- uses: actions/setup-python@v5
Expand Down Expand Up @@ -61,7 +61,7 @@ jobs:
]
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v3
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- uses: actions/setup-python@v5
Expand Down Expand Up @@ -89,7 +89,7 @@ jobs:
]
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v3
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- uses: actions/setup-python@v5
Expand All @@ -115,7 +115,7 @@ jobs:
]
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v3
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- uses: actions/setup-python@v5
Expand All @@ -139,7 +139,7 @@ jobs:
package: ["./packages/autogen-core"]
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v3
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- uses: actions/setup-python@v5
Expand All @@ -160,7 +160,7 @@ jobs:
package: ["./packages/autogen-core"]
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v3
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- uses: actions/setup-python@v5
Expand All @@ -178,7 +178,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v3
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- uses: actions/setup-python@v5
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11
Expand All @@ -73,7 +73,7 @@ jobs:
- name: list available kernels
run: |
python -m jupyter kernelspec list
- uses: astral-sh/setup-uv@v3
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- run: uv sync --locked --all-extras
Expand Down
33 changes: 18 additions & 15 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,29 +31,32 @@ jobs:
matrix:
version:
[
{ ref: main, dest-dir: dev },
{ ref: "v0.4.0.dev0", dest-dir: "0.4.0.dev0" },
{ ref: "v0.4.0.dev1", dest-dir: "0.4.0.dev1" },
{ ref: "v0.4.0.dev2", dest-dir: "0.4.0.dev2" },
{ ref: "v0.4.0.dev3", dest-dir: "0.4.0.dev3" },
{ ref: "v0.4.0.dev4", dest-dir: "0.4.0.dev4" },
{ ref: "v0.4.0.dev5", dest-dir: "0.4.0.dev5" },
{ ref: "v0.4.0.dev6", dest-dir: "0.4.0.dev6" },
{ ref: "v0.4.0.dev7", dest-dir: "0.4.0.dev7" },
{ ref: "v0.4.0.dev8", dest-dir: "0.4.0.dev8" },
{ ref: "v0.4.0.dev9", dest-dir: "0.4.0.dev9" },
{ ref: "v0.4.0.dev10", dest-dir: "0.4.0.dev10" },
{ ref: "v0.4.0.dev11", dest-dir: "0.4.0.dev11" },
# For main use the workflow target
{ ref: "${{github.ref}}", dest-dir: dev, uv-version: "0.5.13" },
{ ref: "v0.4.0.dev0", dest-dir: "0.4.0.dev0", uv-version: "0.5.11" },
{ ref: "v0.4.0.dev1", dest-dir: "0.4.0.dev1", uv-version: "0.5.11" },
{ ref: "v0.4.0.dev2", dest-dir: "0.4.0.dev2", uv-version: "0.5.11" },
{ ref: "v0.4.0.dev3", dest-dir: "0.4.0.dev3", uv-version: "0.5.11" },
{ ref: "v0.4.0.dev4", dest-dir: "0.4.0.dev4", uv-version: "0.5.11" },
{ ref: "v0.4.0.dev5", dest-dir: "0.4.0.dev5", uv-version: "0.5.11" },
{ ref: "v0.4.0.dev6", dest-dir: "0.4.0.dev6", uv-version: "0.5.11" },
{ ref: "v0.4.0.dev7", dest-dir: "0.4.0.dev7", uv-version: "0.5.11" },
{ ref: "v0.4.0.dev8", dest-dir: "0.4.0.dev8", uv-version: "0.5.11" },
{ ref: "v0.4.0.dev9", dest-dir: "0.4.0.dev9", uv-version: "0.5.11" },
{ ref: "v0.4.0.dev10", dest-dir: "0.4.0.dev10", uv-version: "0.5.11" },
{ ref: "v0.4.0.dev11", dest-dir: "0.4.0.dev11", uv-version: "0.5.11" },
{ ref: "v0.4.0.dev12", dest-dir: "0.4.0.dev12", uv-version: "0.5.13" },
]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
lfs: "true"
ref: ${{ matrix.version.ref }}
- uses: astral-sh/setup-uv@v3
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
version: ${{ matrix.version.uv-version }}
- uses: actions/setup-python@v5
with:
python-version: "3.11"
Expand Down Expand Up @@ -99,7 +102,7 @@ jobs:
with:
lfs: "true"
ref: ${{ matrix.version.ref }}
- uses: astral-sh/setup-uv@v3
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- uses: actions/setup-python@v5
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/dotnet-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:
- name: list available kernels
run: |
python -m jupyter kernelspec list
- uses: astral-sh/setup-uv@v3
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- run: uv sync --locked --all-extras
Expand All @@ -103,10 +103,10 @@ jobs:
dotnet build --no-restore --configuration Release -bl /p:SignAssembly=true
- name: Unit Test
run: dotnet test --no-build -bl --configuration Release --filter type=!integration

integration-test:
strategy:
fail-fast: true
fail-fast: true
matrix:
os: [ ubuntu-latest]
version: [ net8.0 ]
Expand All @@ -119,7 +119,7 @@ jobs:
- uses: actions/checkout@v4
with:
lfs: true
- uses: astral-sh/setup-uv@v3
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- uses: actions/setup-python@v5
Expand Down Expand Up @@ -203,7 +203,7 @@ jobs:
- name: list available kernels
run: |
python -m jupyter kernelspec list
- uses: astral-sh/setup-uv@v3
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- uses: actions/setup-python@v5
Expand Down Expand Up @@ -299,4 +299,4 @@ jobs:
env:
MYGET_TOKEN: ${{ secrets.MYGET_TOKEN }}
continue-on-error: true

2 changes: 1 addition & 1 deletion .github/workflows/single-python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
ref: ${{ github.event.inputs.ref }}
# Require ref to be a tag
- run: git show-ref --verify refs/tags/${{ github.event.inputs.ref }}
- uses: astral-sh/setup-uv@v3
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- run: uv build --package ${{ github.event.inputs.package }} --out-dir dist/
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ We will update verion numbers according to the following rules:

1. Create a PR that updates the version numbers across the codebase ([example](https://github.com/microsoft/autogen/pull/4359))
2. The docs CI will fail for the PR, but this is expected and will be resolved in the next step
2. After merging the PR, create and push a tag that corresponds to the new verion. For example, for `0.4.0.dev11`:
- `git tag 0.4.0.dev11 && git push origin 0.4.0.dev11`
2. After merging the PR, create and push a tag that corresponds to the new verion. For example, for `0.4.0.dev12`:
- `git tag 0.4.0.dev12 && git push origin 0.4.0.dev12`
3. Restart the docs CI by finding the failed [job corresponding to the `push` event](https://github.com/microsoft/autogen/actions/workflows/docs.yml) and restarting all jobs
4. Run [this](https://github.com/microsoft/autogen/actions/workflows/single-python-package.yml) workflow for each of the packages that need to be released and get an approval for the release for it to run

Expand Down
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,21 @@

[![Twitter](https://img.shields.io/twitter/url/https/twitter.com/cloudposse.svg?style=social&label=Follow%20%40pyautogen)](https://twitter.com/pyautogen) [![LinkedIn](https://img.shields.io/badge/LinkedIn-Company?style=flat&logo=linkedin&logoColor=white)](https://www.linkedin.com/company/105812540) [![Discord](https://img.shields.io/badge/discord-chat-green?logo=discord)](https://aka.ms/autogen-discord) [![GitHub Discussions](https://img.shields.io/badge/Discussions-Q%26A-green?logo=github)](https://github.com/microsoft/autogen/discussions) [![0.2 Docs](https://img.shields.io/badge/Docs-0.2-blue)](https://microsoft.github.io/autogen/0.2/) [![0.4 Docs](https://img.shields.io/badge/Docs-0.4-blue)](https://microsoft.github.io/autogen/dev/)

[![PyPi autogen-core](https://img.shields.io/badge/PyPi-autogen--core-blue?logo=pypi)](https://pypi.org/project/autogen-core/0.4.0.dev11/) [![PyPi autogen-agentchat](https://img.shields.io/badge/PyPi-autogen--agentchat-blue?logo=pypi)](https://pypi.org/project/autogen-agentchat/0.4.0.dev11/) [![PyPi autogen-ext](https://img.shields.io/badge/PyPi-autogen--ext-blue?logo=pypi)](https://pypi.org/project/autogen-ext/0.4.0.dev11/)
[![PyPi autogen-core](https://img.shields.io/badge/PyPi-autogen--core-blue?logo=pypi)](https://pypi.org/project/autogen-core/0.4.0.dev12/) [![PyPi autogen-agentchat](https://img.shields.io/badge/PyPi-autogen--agentchat-blue?logo=pypi)](https://pypi.org/project/autogen-agentchat/0.4.0.dev12/) [![PyPi autogen-ext](https://img.shields.io/badge/PyPi-autogen--ext-blue?logo=pypi)](https://pypi.org/project/autogen-ext/0.4.0.dev12/)
</div>

# AutoGen

> [!IMPORTANT]
>
> - (12/19/24) Hello!
> - (12/19/24) Hello!
The majority of the AutoGen Team members will be resting and recharging with family and friends over the holiday period. Activity/responses on the project may be delayed during the period of Dec 20-Jan 06. We will be excited to engage with you in the new year!
> - (12/11/24) We have created a new Discord server for the AutoGen community. Join us at [aka.ms/autogen-discord](https://aka.ms/autogen-discord).
> - (11/14/24) ⚠️ In response to a number of asks to clarify and distinguish between official AutoGen and its forks that created confusion, we issued a [clarification statement](https://github.com/microsoft/autogen/discussions/4217).
> - (10/13/24) Interested in the standard AutoGen as a prior user? Find it at the actively-maintained *AutoGen* [0.2 branch](https://github.com/microsoft/autogen/tree/0.2) and `autogen-agentchat~=0.2` PyPi package.
> - (10/02/24) [AutoGen 0.4](https://microsoft.github.io/autogen/dev) is a from-the-ground-up rewrite of AutoGen. Learn more about the history, goals and future at [this blog post](https://microsoft.github.io/autogen/blog). We’re excited to work with the community to gather feedback, refine, and improve the project before we officially release 0.4. This is a big change, so AutoGen 0.2 is still available, maintained, and developed in the [0.2 branch](https://github.com/microsoft/autogen/tree/0.2).
> - *[Join us for Community Office Hours](https://github.com/microsoft/autogen/discussions/4059)* We will host a weekly open discussion to answer questions, talk about Roadmap, etc.

AutoGen is an open-source framework for building AI agent systems.
It simplifies the creation of event-driven, distributed, scalable, and resilient agentic applications.
It allows you to quickly build systems where AI agents collaborate and perform tasks autonomously
Expand Down Expand Up @@ -108,7 +107,7 @@ We look forward to your contributions!
First install the packages:

```bash
pip install "autogen-agentchat==0.4.0.dev11" "autogen-ext[openai]==0.4.0.dev11"
pip install "autogen-agentchat==0.4.0.dev12" "autogen-ext[openai]==0.4.0.dev12"
```

The following code uses OpenAI's GPT-4o model and you need to provide your
Expand Down
7 changes: 6 additions & 1 deletion docs/switcher.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,12 @@
{
"name": "0.4.0.dev11",
"version": "0.4.0.dev11",
"url": "/autogen/0.4.0.dev11/",
"url": "/autogen/0.4.0.dev11/"
},
{
"name": "0.4.0.dev12",
"version": "0.4.0.dev12",
"url": "/autogen/0.4.0.dev12/",
"preferred": true
}
]
22 changes: 16 additions & 6 deletions dotnet/src/AutoGen/LMStudioConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,28 @@ namespace AutoGen;
/// </summary>
public class LMStudioConfig : ILLMConfig
{
public LMStudioConfig(string host, int port)
public LMStudioConfig(string host, int port, string modelName)
{
this.Host = host;
this.Port = port;
this.Uri = new Uri($"http://{host}:{port}");
this.Uri = new Uri($"http://{host}:{port}/v1");
if (modelName == null)
{
throw new ArgumentNullException("modelName is a required property for LMStudioConfig and cannot be null");
}
this.ModelName = modelName;
}

public LMStudioConfig(Uri uri)
public LMStudioConfig(Uri uri, string modelName)
{
this.Uri = uri;
this.Host = uri.Host;
this.Port = uri.Port;
if (modelName == null)
{
throw new ArgumentNullException("modelName is a required property for LMStudioConfig and cannot be null");
}
this.ModelName = modelName;
}

public string Host { get; }
Expand All @@ -33,15 +43,15 @@ public LMStudioConfig(Uri uri)

public Uri Uri { get; }

public string ModelName { get; }

internal ChatClient CreateChatClient()
{
var client = new OpenAIClient(new ApiKeyCredential("api-key"), new OpenAIClientOptions
{
Endpoint = this.Uri,
});

// model name doesn't matter for LM Studio

return client.GetChatClient("model-name");
return client.GetChatClient(this.ModelName);
}
}
2 changes: 1 addition & 1 deletion python/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# AutoGen Python packages

[![0.4 Docs](https://img.shields.io/badge/Docs-0.4-blue)](https://microsoft.github.io/autogen/dev/)
[![PyPi autogen-core](https://img.shields.io/badge/PyPi-autogen--core-blue?logo=pypi)](https://pypi.org/project/autogen-core/0.4.0.dev11/) [![PyPi autogen-agentchat](https://img.shields.io/badge/PyPi-autogen--agentchat-blue?logo=pypi)](https://pypi.org/project/autogen-agentchat/0.4.0.dev11/) [![PyPi autogen-ext](https://img.shields.io/badge/PyPi-autogen--ext-blue?logo=pypi)](https://pypi.org/project/autogen-ext/0.4.0.dev11/)
[![PyPi autogen-core](https://img.shields.io/badge/PyPi-autogen--core-blue?logo=pypi)](https://pypi.org/project/autogen-core/0.4.0.dev12/) [![PyPi autogen-agentchat](https://img.shields.io/badge/PyPi-autogen--agentchat-blue?logo=pypi)](https://pypi.org/project/autogen-agentchat/0.4.0.dev12/) [![PyPi autogen-ext](https://img.shields.io/badge/PyPi-autogen--ext-blue?logo=pypi)](https://pypi.org/project/autogen-ext/0.4.0.dev12/)

This directory works as a single `uv` workspace containing all project packages. See [`packages`](./packages/) to discover all project packages.

Expand Down
4 changes: 2 additions & 2 deletions python/packages/agbench/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ dependencies = [
"scipy"
]

[tool.uv]
dev-dependencies = [
[dependency-groups]
dev = [
"types-tabulate",
"types-docker"
]
Expand Down
8 changes: 2 additions & 6 deletions python/packages/autogen-agentchat/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "autogen-agentchat"
version = "0.4.0.dev11"
version = "0.4.0.dev12"
license = {file = "LICENSE-CODE"}
description = "AutoGen agents and teams library"
readme = "README.md"
Expand All @@ -15,13 +15,9 @@ classifiers = [
"Operating System :: OS Independent",
]
dependencies = [
"autogen-core==0.4.0.dev11",
"autogen-core==0.4.0.dev12",
]

[tool.uv]
dev-dependencies = []


[tool.ruff]
extend = "../../pyproject.toml"
include = ["src/**", "tests/*.py"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,14 @@ class AssistantAgent(BaseChatAgent):
the inner messages as they are created, and the :class:`~autogen_agentchat.base.Response`
object as the last item before closing the generator.
.. note::
The caller must only pass the new messages to the agent on each call
to the :meth:`on_messages` or :meth:`on_messages_stream` method.
The agent maintains its state between calls to these methods.
Do not pass the entire conversation history to the agent on each call.
Tool call behavior:
* If the model returns no tool call, then the response is immediately returned as a :class:`~autogen_agentchat.messages.TextMessage` in :attr:`~autogen_agentchat.base.Response.chat_message`.
Expand Down Expand Up @@ -290,7 +298,9 @@ def __init__(
raise ValueError(
f"Handoff names must be unique from tool names. Handoff names: {handoff_tool_names}; tool names: {tool_names}"
)
if not model_context:
if model_context is not None:
self._model_context = model_context
else:
self._model_context = UnboundedChatCompletionContext()
self._reflect_on_tool_use = reflect_on_tool_use
self._tool_call_summary_format = tool_call_summary_format
Expand Down
Loading

0 comments on commit f5a14c6

Please sign in to comment.