|
| 1 | +# Settings |
| 2 | + |
| 3 | +## Settings Class Overview |
| 4 | + |
| 5 | +The configuration is defined in a class named `CodeInterpreterAPISettings`, which inherits from Pydantic's `BaseSettings` class. |
| 6 | + |
| 7 | +`codeinterpreterapi/config.py` |
| 8 | +```python |
| 9 | +class CodeInterpreterAPISettings(BaseSettings): |
| 10 | +... |
| 11 | +``` |
| 12 | + |
| 13 | +## Setting Descriptions |
| 14 | + |
| 15 | +### Debug Settings |
| 16 | + |
| 17 | +- `DEBUG: bool = False` |
| 18 | +Enables or disables the debug mode. |
| 19 | + |
| 20 | +### API Keys |
| 21 | + |
| 22 | +- `OPENAI_API_KEY: Optional[str] = None` |
| 23 | +API key for the OpenAI service. |
| 24 | + |
| 25 | +- `AZURE_API_KEY: Optional[str] = None` |
| 26 | +API key for the Azure service. |
| 27 | + |
| 28 | +- `AZURE_API_BASE: Optional[str] = None` |
| 29 | +Base URL for Azure API. |
| 30 | + |
| 31 | +- `AZURE_API_VERSION: Optional[str] = None` |
| 32 | +API version for Azure service. |
| 33 | + |
| 34 | +- `AZURE_DEPLOYMENT_NAME: Optional[str] = None` |
| 35 | +Deployment name for Azure service. |
| 36 | + |
| 37 | +- `ANTHROPIC_API_KEY: Optional[SecretStr] = None` |
| 38 | +API key for the Anthropic service, stored securely. |
| 39 | + |
| 40 | +### LLM Settings |
| 41 | + |
| 42 | +- `MODEL: str = "gpt-3.5-turbo"` |
| 43 | +The language model to be used. |
| 44 | + |
| 45 | +- `TEMPERATURE: float = 0.03` |
| 46 | +Controls randomness in the model's output. |
| 47 | + |
| 48 | +- `DETAILED_ERROR: bool = True` |
| 49 | +Enables or disables detailed error messages. |
| 50 | + |
| 51 | +- `SYSTEM_MESSAGE: SystemMessage = code_interpreter_system_message` |
| 52 | +Sets the default system message |
| 53 | + |
| 54 | +- `REQUEST_TIMEOUT: int = 3 * 60` |
| 55 | +API request timeout in seconds. |
| 56 | + |
| 57 | +- `MAX_ITERATIONS: int = 12` |
| 58 | +Maximum number of iterations for certain operations. |
| 59 | + |
| 60 | +- `MAX_RETRY: int = 3` |
| 61 | +Maximum number of API request retries. |
| 62 | + |
| 63 | +### Production Settings |
| 64 | + |
| 65 | +- `HISTORY_BACKEND: Optional[str] = None` |
| 66 | +Specifies the history backend to be used. |
| 67 | + |
| 68 | +- `REDIS_URL: str = "redis://localhost:6379"` |
| 69 | +URL for Redis server. |
| 70 | + |
| 71 | +- `POSTGRES_URL: str = "postgresql://postgres:postgres@localhost:5432/postgres"` |
| 72 | +URL for PostgreSQL server. |
| 73 | + |
| 74 | +### CodeBox |
| 75 | + |
| 76 | +- `CODEBOX_API_KEY: Optional[str] = None` |
| 77 | +API key for the CodeBox service. |
| 78 | + |
| 79 | +- `CUSTOM_PACKAGES: list[str] = []` |
| 80 | +List of custom Python packages to be used. |
| 81 | + |
| 82 | +### Deprecated |
| 83 | + |
| 84 | +- `VERBOSE: bool = DEBUG` |
| 85 | +This setting is deprecated and should not be used. It defaults to the value of `DEBUG`. |
0 commit comments