Skip to content

Commit

Permalink
Semantic kernel model adapter (#4851)
Browse files Browse the repository at this point in the history
* initial sk model adapter implementation

* add sk tool module

* implement streaming and update tests

* update lock

* linting

* add semantic kernel extras

* add docstring and format

* update dependencies and format/lint

* add model info to sk constructor

* update uv.lock

* customize prompt settings

* update uv.lock

* add docs

* fix sk docstring linting

* update create docstrings

* fmt and improve tool docstring

* update sk tool docs

* coerce doc json serialization failure

---------

Co-authored-by: Leonardo Pinheiro <[email protected]>
  • Loading branch information
lspinheiro and lpinheiroms authored Jan 18, 2025
1 parent 9b1260d commit 918292f
Show file tree
Hide file tree
Showing 12 changed files with 2,307 additions and 21 deletions.
1 change: 1 addition & 0 deletions python/packages/autogen-core/docs/src/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@
}

autodoc_pydantic_model_show_config_summary = False
autodoc_pydantic_model_show_json_error_strategy = "coerce"
python_use_unqualified_type_names = True
autodoc_preserve_defaults = True

Expand Down
2 changes: 2 additions & 0 deletions python/packages/autogen-core/docs/src/reference/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,11 @@ python/autogen_ext.teams.magentic_one
python/autogen_ext.models.cache
python/autogen_ext.models.openai
python/autogen_ext.models.replay
python/autogen_ext.models.semantic_kernel
python/autogen_ext.tools.langchain
python/autogen_ext.tools.graphrag
python/autogen_ext.tools.code_execution
python/autogen_ext.tools.semantic_kernel
python/autogen_ext.code_executors.local
python/autogen_ext.code_executors.docker
python/autogen_ext.code_executors.azure
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
autogen\_ext.models.semantic_kernel
====================================


.. automodule:: autogen_ext.models.semantic_kernel
:members:
:undoc-members:
:show-inheritance:
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
autogen\_ext.tools.semantic_kernel
===================================


.. automodule:: autogen_ext.tools.semantic_kernel
:members:
:undoc-members:
:show-inheritance:


44 changes: 44 additions & 0 deletions python/packages/autogen-ext/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,50 @@ grpc = [
"grpcio~=1.62.0", # TODO: update this once we have a stable version.
]

semantic-kernel-core = [
"semantic-kernel>=1.17.1",
]

semantic-kernel-google = [
"semantic-kernel[google]>=1.17.1",
]

semantic-kernel-hugging-face = [
"semantic-kernel[hugging_face]>=1.17.1",
]

semantic-kernel-mistralai = [
"semantic-kernel[mistralai]>=1.17.1",
]

semantic-kernel-ollama = [
"semantic-kernel[ollama]>=1.17.1",
]

semantic-kernel-onnx = [
"semantic-kernel[onnx]>=1.17.1",
]

semantic-kernel-anthropic = [
"semantic-kernel[anthropic]>=1.17.1",
]

semantic-kernel-pandas = [
"semantic-kernel[pandas]>=1.17.1",
]

semantic-kernel-aws = [
"semantic-kernel[aws]>=1.17.1",
]

semantic-kernel-dapr = [
"semantic-kernel[dapr]>=1.17.1",
]

semantic-kernel-all = [
"semantic-kernel[google,hugging_face,mistralai,ollama,onnx,anthropic,usearch,pandas,aws,dapr]>=1.17.1",
]

[tool.hatch.build.targets.wheel]
packages = ["src/autogen_ext"]

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from ._sk_chat_completion_adapter import SKChatCompletionAdapter

__all__ = ["SKChatCompletionAdapter"]
Loading

0 comments on commit 918292f

Please sign in to comment.