Skip to main content
Semantic Kernel is an open-source development tool that allows you to build agents and integrate the latest AI models into your codebase.

Prerequisites

Before getting started, ensure you have:
  • A SambaCloud account and API key.
  • Python 3.10 or later. Run python --version to confirm. Semantic Kernel 1.0 and later requires Python 3.10, and on Python 3.9 pip installs the incompatible 0.9 beta instead.

Installation and setup

  1. Create a virtual environment.
    If python --version reports 3.9 or earlier, create the environment with an explicit interpreter instead, for example python3.11 -m venv .venv.
  2. Install the required libraries.
    The upper bound keeps you on the 1.x agent API. Semantic Kernel changed the ChatCompletionAgent constructor between 0.9 and 1.0, so pin the major version and test before you upgrade.
  3. Create a .env file in the same directory and add your credentials. SambaCloud exposes an OpenAI-compatible endpoint, so Semantic Kernel connects to it through the standard OpenAI connector.
    Leave the unused IDs empty. OpenAIChatCompletion reads these variables at construction time, so the notebook fails at the first agent call if they are missing. Pass any SambaCloud model as OPENAI_CHAT_MODEL_ID. Agent workflows that give agents tools also need a model that supports function calling.

Example notebook

Follow along with the Semantic Kernel example notebook to create agents that can function as art directors and copywriters, helping automate creative tasks with advanced AI capabilities.
If the first agent cell fails with TypeError: ChatCompletionAgent.__init__() got an unexpected keyword argument 'service_id', apply the one-line fix in Troubleshooting. The pinned 1.x API no longer accepts service_id on the agent constructor.
Launch Jupyter from the environment you just created so the notebook runs against it:
If you open the notebook in an editor such as VS Code instead, select the interpreter inside .venv before you run any cells. Selecting an interpreter does not restart an already-running kernel, so restart the kernel afterward. To confirm which interpreter is actually attached, run import sys, os; print(sys.executable, os.environ.get("VIRTUAL_ENV")) in a cell. A VIRTUAL_ENV of None means the kernel is running outside the environment.

Troubleshooting

You installed the 0.9 beta, which is the last release that supports Python 3.9. On Python 3.9, pip selects it silently because 1.0 and later require Python 3.10.Confirm python --version is 3.10 or later, then recreate the environment and reinstall with the bounded command in Installation and setup. Upgrading in place does not help, because no 1.x release installs on Python 3.9.
ChatCompletionAgent accepted service_id in 0.9. In 1.0 and later, the agent takes a configured kernel or service instead.Remove the service_id argument from the agent constructor. Keep it on OpenAIChatCompletion, which still accepts it.
The notebook kernel is running outside your virtual environment, usually because the editor started it from a different interpreter.Restart the kernel after selecting the environment, then verify with the check in the note above. Launching jupyter lab from the activated environment avoids the problem entirely.
OPENAI_API_KEY is unset, expired, or the .env file is not in the directory the notebook runs from.Confirm the key works with a completion request:
A 200 confirms the key is valid. Test against a completion request rather than a model listing, because the models endpoint answers without checking credentials.

Additional resources