Skip to content

Latest commit

 

History

History
119 lines (69 loc) · 5.14 KB

File metadata and controls

119 lines (69 loc) · 5.14 KB

Setup SAP Business Application Studio and your personald development space

SAP Business Application Studio is based on Code-OSS, an open-source project used for building Visual Studio Code. Available as a cloud service, SAP Business Application Studio (BAS) provides a desktop-like experience similar to leading IDEs, with command line and optimized editors.

At the heart of SAP Business Application Studio are the dev spaces. The dev spaces are comparable to isolated virtual machines in the cloud containing tailored tools and pre-installed runtimes per business scenario, such as SAP Fiori, SAP S/4HANA extensions, Workflow, HANA native development and more. This simplifies and speeds up the setup of your development environment, enabling you to efficiently develop, test, build, and run your solutions locally or in the cloud.

Open SAP Business Application Studio

👉 Go back to the BTP cockpit.

👉 Navigate to Instances and Subscriptions and open SAP Business Application Studio.

Open BAS

Create a new Dev Space for CodeJam exercises

👉 Create a new Dev Space.

Create a Dev Space 1

👉 Enter the name of the dev space GenAICodeJam_XX, select the Basic kind of application and Python Tools from Additional SAP Extensions.

Replace the XX with your initials.

👉 Click Create Dev Space.

Create a Dev Space 2

You should see the dev space STARTING.

Dev Space is Starting

👉 Wait for the dev space to get into the RUNNING state and then open it.

Dev Space is Running

Clone the exercises from the Git repository

👉 Once you opened your dev space in BAS, use one of the available options to clone this Git repository with exercises using the URL below:

https://github.com/SAP-samples/codejam-code-based-agents.git

Clone the repo

👉 Click Open to open a project in the Explorer view.

Open a project

Configure the connection details to Generative AI Hub

👉 Go back to the Subaccount in the BTP cockpit.

👉 Navigate to Instances and Subscriptions and open the SAP AI Core instance's service binding.

Service Binding in the BTP Cockpit

👉 Click Copy JSON.

👉 Return to BAS and create a new file .env in the /project/Python/starter-project/.env directory.

👉 Update the variables using the service key into /project/Python/starter-project/.env, which should look similar to the following.

👉 Make sure you also assign the correct AICORE_RESOURCE_GROUP, we will use ai-agents-codejam for this CodeJam.

☝️ You will update the RPT-1_DEPLOYMENT_URL in a later exercise.

LITELLM_PROVIDER="sap"
AICORE_AUTH_URL="https://#####.authentication.eu10.hana.ondemand.com/oauth/token"
AICORE_CLIENT_ID="sb-3c636fc2-d352-496a-851d-7a7d6005dcd4!b505946|aicore!b540"
AICORE_CLIENT_SECRET="#####"
AICORE_RESOURCE_GROUP="ai-agents-codejam"
AICORE_BASE_URL="https://api.ai.prod.eu-central-1.aws.ml.hana.ondemand.com"
RPT1_DEPLOYMENT_URL="https://api.ai.prod.eu-central-1.aws.ml.hana.ondemand.com/v2/inference/deployments/###/predict"

Create a Python virtual environment and install the LiteLLM and CrewAI

👉 Start a new Terminal.

Start terminal

👉 Verify your Python version is compatible with CrewAI (requires Python 3.10, 3.11, 3.12, or 3.13):

python3 --version

⚠️ Important: CrewAI requires Python 3.10 or newer (up to 3.13). If your Python version is 3.9 or older, you'll need to install a compatible version. On macOS, you can use Homebrew to install Python 3.11: brew install python@3.11, then use python3.11 instead of python3 in the commands below.

👉 Create a virtual environment using the following command:

python3 -m venv ~/projects/codejam-code-based-agents/env --upgrade-deps

👉 Activate the env virtual environment like this and make sure it is activated:

source ~/projects/codejam-code-based-agents/env/bin/activate

venv

👉 Install LiteLLM, CrewAI, and python-dotenv using the following pip install commands.

pip install litellm crewai python-dotenv

In case you see a message in BAS asking you to create an isolated environment, click on Don't show again.

bas-message

Let's start coding!

Next exercise