Skip to content

Commit 7243188

Browse files
authored
Python: Use BaseModel instead of KernelBaseModel in samples (#12224)
### Motivation and Context <!-- Thank you for your contribution to the semantic-kernel repo! Please help reviewers and future users, providing the following information: 1. Why is this change required? 2. What problem does it solve? 3. What scenario does it contribute to? 4. If it fixes an open issue, please link to the issue here. --> It's unnecessary to use `KernelBaseModel` in the samples. ### Description <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> Switch to `BaseModel`. ### Contribution Checklist <!-- Before submitting this PR, please make sure: --> - [x] The code builds clean without any errors or warnings - [x] The PR follows the [SK Contribution Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [x] All unit tests pass, and I have added new tests where possible - [x] I didn't break anyone 😄
1 parent 0eec353 commit 7243188

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

python/samples/getting_started_with_agents/multi_agent_orchestration/step4a_handoff_structured_inputs.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@
33
import asyncio
44
from enum import Enum
55

6+
from pydantic import BaseModel
7+
68
from semantic_kernel.agents import Agent, ChatCompletionAgent, HandoffOrchestration, OrchestrationHandoffs
79
from semantic_kernel.agents.runtime import InProcessRuntime
810
from semantic_kernel.connectors.ai.open_ai import OpenAIChatCompletion
911
from semantic_kernel.contents import AuthorRole, ChatMessageContent
1012
from semantic_kernel.functions import kernel_function
11-
from semantic_kernel.kernel_pydantic import KernelBaseModel
1213

1314
"""
1415
The following sample demonstrates how to create a handoff orchestration that can triage
@@ -37,7 +38,7 @@ class GitHubLabels(Enum):
3738
AGENT = "agent"
3839

3940

40-
class GithubIssue(KernelBaseModel):
41+
class GithubIssue(BaseModel):
4142
"""Model representing a GitHub issue."""
4243

4344
id: str
@@ -46,7 +47,7 @@ class GithubIssue(KernelBaseModel):
4647
labels: list[str] = []
4748

4849

49-
class Plan(KernelBaseModel):
50+
class Plan(BaseModel):
5051
"""Model representing a plan for resolving a GitHub issue."""
5152

5253
tasks: list[str]

0 commit comments

Comments
 (0)