From 956ad1976cf3ea4198a3720c63be073bb57d684d Mon Sep 17 00:00:00 2001 From: lidia9 Date: Wed, 14 May 2025 11:56:27 +0200 Subject: [PATCH] modifs --- docs/cai/getting-started/installation.md | 21 ++++++++++++++++++--- docs/cai_installation.md | 17 +++++++++++++++-- docs/cai_quickstart.md | 14 ++++++++++---- mkdocs.yml | 5 +++-- 4 files changed, 46 insertions(+), 11 deletions(-) diff --git a/docs/cai/getting-started/installation.md b/docs/cai/getting-started/installation.md index 56cdc4f1..fcdb3044 100644 --- a/docs/cai/getting-started/installation.md +++ b/docs/cai/getting-started/installation.md @@ -63,9 +63,10 @@ cai # first launch it can take up to 30 seconds ``` ## Windows WSL -Go to the Microsoft page: https://learn.microsoft.com/en-us/windows/wsl/install. Here you will find all the instructions to install WSL +Go to the Microsoft page: `https://learn.microsoft.com/en-us/windows/wsl/install`. +Here you will find all the instructions to install WSL -From Powershell write: wsl --install +From Powershell write: ` wsl --install` ```bash sudo apt-get update && \ @@ -125,4 +126,18 @@ cp .env.example .env # edit here your keys/models # Launch CAI cai -``` \ No newline at end of file +``` + +### Custom OpenAI Base URL Support + +CAI supports configuring a custom OpenAI API base URL via the `OPENAI_BASE_URL` environment variable. This allows users to redirect API calls to a custom endpoint, such as a proxy or self-hosted OpenAI-compatible service. + +Example `.env` entry configuration: +``` +OLLAMA_API_BASE="https://custom-openai-proxy.com/v1" +``` + +Or directly from the command line: +```bash +OLLAMA_API_BASE="https://custom-openai-proxy.com/v1" cai +``` diff --git a/docs/cai_installation.md b/docs/cai_installation.md index 2fb0acd6..84de3bb5 100644 --- a/docs/cai_installation.md +++ b/docs/cai_installation.md @@ -145,7 +145,20 @@ ANTHROPIC_API_KEY="" OLLAMA="" PROMPT_TOOLKIT_NO_CPR=1 ``` - - ⚠️ CAI does NOT provide API keys for any model by default. + +### Custom OpenAI Base URL Support +``` +CAI supports configuring a custom OpenAI API base URL via the `OPENAI_BASE_URL` environment variable. This allows users to redirect API calls to a custom endpoint, such as a proxy or self-hosted OpenAI-compatible service. + +Example `.env` entry configuration: +``` +OLLAMA_API_BASE="https://custom-openai-proxy.com/v1" +``` + +Or directly from the command line: +```bash +OLLAMA_API_BASE="https://custom-openai-proxy.com/v1" cai +``` + diff --git a/docs/cai_quickstart.md b/docs/cai_quickstart.md index 37f4e4d8..e22ccbdc 100644 --- a/docs/cai_quickstart.md +++ b/docs/cai_quickstart.md @@ -58,7 +58,9 @@ From here on, type on `CAI` and start your security exercise. Best way to learn There are several ways to configure environment variables for CAI: -1. **Using the `.env` file**: +--- + +### 1. Using the `.env` file ``` # Add any env variable to your .env file @@ -66,13 +68,17 @@ CAI_PRICE_LIMIT="0.004" CAI_MODEL="qwen2.5:72b" ``` -2. **Command-line parameters**: Pass variables directly when launching CAI +### 2. Command-line parameters + +Pass variables directly when launching CAI ``` CAI_PRICE_LIMIT="0.004" CAI_MODEL="qwen2.5:72b" cai ``` -3. **Runtime configuration**: after running CAI, use `/config` +### 3. Runtime configuration + +After running CAI, use `/config` ``` /config set to configure a variable # see `config.py` or type `/help` @@ -85,4 +91,4 @@ CAI_PRICE_LIMIT="0.004" CAI_MODEL="qwen2.5:72b" cai # You must pick its reference NUMBER (1st column left) # `18` is the corresponding number for CAI_PRICE_LIMIT /config set 18 "0.004" -``` \ No newline at end of file +``` diff --git a/mkdocs.yml b/mkdocs.yml index 21a04665..42ef9c7a 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -30,12 +30,13 @@ nav: #- Quickstart: quickstart.md #- Examples: examples.md - Documentation: - - agents.md # + - agents.md - running_agents.md - results.md - streaming.md - tools.md - - mcp.md + #- mcp.md + #- cai_mcp.md - handoffs.md - tracing_cai.md - context.md