Skip to content

Commit

Permalink
Python: Refactor chat completion concept samples (#9822)
Browse files Browse the repository at this point in the history
### 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.
-->
Our chat completion concept samples are not well organized and
over-complicated with prompts and different settings.

### Description

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->
This PR refactors the samples such that they only capture the essential
concepts to the chat completion services. This PR also adds sample usage
for all supported chat completion services in Semantic Kernel Python.

### 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 😄
  • Loading branch information
TaoChenOSU authored Nov 27, 2024
1 parent 370c89a commit 8dadef2
Show file tree
Hide file tree
Showing 18 changed files with 905 additions and 917 deletions.
1 change: 1 addition & 0 deletions python/samples/concepts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ This section contains code snippets that demonstrate the usage of Semantic Kerne
| Features | Description |
| -------- | ----------- |
| Agents | Creating and using [agents](../../semantic_kernel/agents/) in Semantic Kernel |
| Audio | Using services that support audio-to-text and text-to-audio conversion |
| AutoFunctionCalling | Using `Auto Function Calling` to allow function call capable models to invoke Kernel Functions automatically |
| ChatCompletion | Using [`ChatCompletion`](https://github.com/microsoft/semantic-kernel/blob/main/python/semantic_kernel/connectors/ai/chat_completion_client_base.py) messaging capable service with models |
| ChatHistory | Using and serializing the [`ChatHistory`](https://github.com/microsoft/semantic-kernel/blob/main/python/semantic_kernel/contents/chat_history.py) |
Expand Down
110 changes: 0 additions & 110 deletions python/samples/concepts/chat_completion/azure_chat_gpt_api.py

This file was deleted.

76 changes: 0 additions & 76 deletions python/samples/concepts/chat_completion/azure_chat_image_input.py

This file was deleted.

89 changes: 0 additions & 89 deletions python/samples/concepts/chat_completion/chat_anthropic_api.py

This file was deleted.

94 changes: 0 additions & 94 deletions python/samples/concepts/chat_completion/chat_bedrock_api.py

This file was deleted.

Loading

0 comments on commit 8dadef2

Please sign in to comment.