mirror of
https://github.com/microsoft/semantic-kernel.git
synced 2026-10-12 02:19:06 +00:00
### Motivation and Context This replaces passing Logger instances as arguments around with the preferred Python way of having each module define a module-wide `logger` instance at the top of the module. Fixes #3711 ### Description Removes any `log` argument and argument documentation. Replaces usage of those `log` arguments with the module-wide `logger` instance. ### Contribution Checklist - [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 😄 --------- Co-authored-by: Eduard van Valkenburg <[email protected]>
4.4 KiB
4.4 KiB
In [ ]:
!python -m pip install semantic-kernel==0.4.3.dev0In [ ]:
import semantic_kernel as sk
from semantic_kernel.connectors.ai.open_ai import AzureChatCompletion, OpenAIChatCompletionIn [ ]:
# Simple instance
kernel_1 = sk.Kernel()In [ ]:
kernel = sk.Kernel()
kernel.add_chat_service( # We are adding a text service
"Azure_curie", # The alias we can use in prompt templates' config.json
AzureChatCompletion(
deployment_name="my-finetuned-Curie", # Azure OpenAI *Deployment name*
endpoint="https://contoso.openai.azure.com/", # Azure OpenAI *Endpoint*
api_key="...your Azure OpenAI Key..." # Azure OpenAI *Key*
)
)
kernel.add_chat_service( # We are adding a text service
"OpenAI_chat_gpt", # The alias we can use in prompt templates' config.json
OpenAIChatCompletion(
ai_model_id="gpt-3.5-turbo", # OpenAI Model Name
api_key="...your OpenAI API Key...", # OpenAI API key
org_id="...your OpenAI Org ID..." # *optional* OpenAI Organization ID
)
)In [ ]:
kernel.set_default_text_completion_service("Azure_curie")