Skip to content

Commit

Permalink
updated documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
mfaizanse committed Jan 28, 2025
1 parent 5ff0419 commit ce2e438
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 116 deletions.
18 changes: 1 addition & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,22 +63,6 @@ poetry install

This creates a new virtual environment and installs the project's dependencies.

### Activate the Virtual Environment

To use the virtual environment, follow this procedure.

> [!NOTE] Run these commands in the root directory of your project, where the `pyproject.toml` file is located.
1. Use `poetry shell` to start a new shell session with the virtual environment activated:

```bash
poetry shell
```

Now, you can run Python and any installed packages in this shell. They will use the virtual environment.
2. Use `poetry run` to execute a command.
3. Use the `deactivate` command to exit the virtual environment.

If you are a PyCharm user and want to use the virtual environment created by Poetry, follow the [configuration guides](https://www.jetbrains.com/help/pycharm/poetry.html).

## Use Poe the Poet as Task Runner
Expand Down Expand Up @@ -144,7 +128,7 @@ poetry poe codecheck
To fix linting and formatting issues, use the following command:

```bash
poetry poe codefix
poetry poe code-fix
```

Mypy does not support fixing issues automatically.
Expand Down
43 changes: 43 additions & 0 deletions config/config-example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"AICORE_AUTH_URL": "<VALUE>",
"AICORE_BASE_URL": "<VALUE>",
"AICORE_CLIENT_ID": "<VALUE>",
"AICORE_CLIENT_SECRET": "<VALUE>",
"AICORE_RESOURCE_GROUP": "default",

"REDIS_URL": "redis://localhost:6379",
"REDIS_HOST": "localhost",
"REDIS_PORT": "6379",

"TEST_CLUSTER_URL": "<VALUE>",
"TEST_CLUSTER_CA_DATA": "<VALUE>",
"TEST_CLUSTER_AUTH_TOKEN": "<VALUE>",

"LANGFUSE_HOST": "<VALUE>",
"LANGFUSE_SECRET_KEY": "<VALUE>",
"LANGFUSE_PUBLIC_KEY": "<VALUE>",
"LANGFUSE_ENABLED": "True",

"DATABASE_URL": "<VALUE>",
"DATABASE_USER": "<VALUE>",
"DATABASE_PASSWORD": "<VALUE>",
"DATABASE_PORT": "443",
"DOCS_TABLE_NAME": "<VALUE>",

"models": [
{
"name": "gpt-4o",
"deployment_id": "<VALUE>",
"temperature": 0
},
{
"name": "gpt-4o-mini",
"deployment_id": "<VALUE>",
"temperature": 0
},
{
"name": "text-embedding-3-large",
"deployment_id": "<VALUE>"
}
]
}
31 changes: 3 additions & 28 deletions doc_indexer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,35 +19,10 @@ To run the project locally, follow these steps:
poetry install
```

2. Create .env file in the root of the project and add the following variables:
```yaml
LOG_LEVEL=INFO # Set the log level to INFO, DEBUG, WARNING, or ERROR

# AI Core credentials
AICORE_AUTH_URL=
AICORE_CLIENT_ID=
AICORE_CLIENT_SECRET=
AICORE_RESOURCE_GROUP=
AICORE_BASE_URL=

# Embedding Model
EMBEDDING_MODEL_DEPLOYMENT_ID=
EMBEDDING_MODEL_NAME=

# Kyma docs path
DOCS_SOURCES_FILE_PATH= # Path to the file with the list of documentation sources. Default: "docs_sources.json"
DOCS_PATH=...

# HANA Cloud DB
DATABASE_URL=
DATABASE_PORT=
DATABASE_USER=
DATABASE_PASSWORD=
```
2. Prepare the `config-doc-indexer.json` file based on the [template](../../config/config-example.json).

It is important to pay attention that `DOCS_PATH` is the path to the Kyma documentation markdown files.
3. Run the fetcher to pull documents from the specified sources in the `docs_sources.json` [file](./docs_sources.json):

3. Run the fetcher to pull documents from the specified sources in the `DOCS_SOURCES_FILE_PATH` file:
```bash
poetry run python src/main.py fetch
```
Expand All @@ -59,7 +34,7 @@ poetry run python src/main.py index

## Testing

The `.env` file can also be used for testing. You can create a separate `.env.test` file with similar content to `.env`.
The `config-doc-indexer.json` file can also be used for testing.
To run the unit and integration tests, use the following command:

```bash
Expand Down
30 changes: 3 additions & 27 deletions tests/blackbox/evaluation.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,40 +23,16 @@ To run the Evaluation tests, follow these steps:
poetry install
```

2. Prepare the `.env.evaluation` file based on the following template:
2. Prepare the `config-evaluation.json` file based on the [template](../../config/config-example.json).

```
LOG_LEVEL= # Allowed values: "INFO", "DEBUG", "ERROR", "WARNING"
TEST_DATA_PATH= # Directory path of test data. e.g. "/Users/<username>/git/kyma-project/kyma-companion/tests/data".
MODEL_NAME= # [Optional] Model name to use for validator.
COMPANION_API_URL= # Kyma Companion API URL. e.g. "http://localhost:8080/api/v1/pods/stream".
COMPANION_TOKEN= # [Optional] Kyma Companion API Authentication Token.
TEST_CLUSTER_URL= # Kubernetes Cluster (with test-cases configured) URL.
TEST_CLUSTER_CA_DATA= # Kubernetes Cluster (with test-cases configured) Certificate Authority Data.
TEST_CLUSTER_AUTH_TOKEN= # Kubernetes Cluster (with test-cases configured) Authentication Token.
AICORE_AUTH_URL= # AI-Core Auth URL.
AICORE_BASE_URL= # AI-Core Base URL.
AICORE_CLIENT_ID= # AI-Core Client ID.
AICORE_CLIENT_SECRET= # AI-Core Client Secret.
AICORE_RESOURCE_GROUP= # AI-Core Resource Group.
AICORE_CONFIGURATION_ID_GPT4_MINI= # AI-Core Configuration ID for GPT-4 mini.
AICORE_DEPLOYMENT_ID_GPT4_MINI= # AI-Core Deployment ID for GPT-4 mini.
DEFAULT_RETRY_WAIT_TIME= # [Optional] The number of seconds we increase the retry wait time by when querying the Companion API. Default is 60.
DEFAULT_RETRY_MAX_WAIT_TIME= # [Optional] The maximum retry wait time in seconds when querying the Companion API. Default is 600.

```

3. Run the following command to set up the environment variables in your system:
3. Run the following command to set up `CONFIG_PATH` environment variable in your system:

```bash
export $(xargs < .env.evaluation)
export CONFIG_PATH=<path_to_config-evaluation.json>
```

4. Run the Evaluation tests:

```bash
poetry run python src/run_evaluation.py
# OR
poetry shell
python src/run_evaluation.py
```
29 changes: 3 additions & 26 deletions tests/blackbox/validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,39 +12,16 @@ To run the validation, follow these steps:
poetry install
```

2. Add LLMs data to `config/validation/models.yml` that are to be validated. The data should be in the following format:
2. Prepare the `config-validation.json` file based on the [template](../../config/config-example.json).

```yaml
- name: "gpt-4"
deployment_id: {deployment_id_gpt_4}
- name: "gemini-1.5-pro"
deployment_id: {deployment_id_gemini_1_5_pro}
```

3. Prepare the `.env.validation` file based on the following template:

```
AICORE_AUTH_URL= # AI-Core Auth URL.
AICORE_BASE_URL= # AI-Core Base URL.
AICORE_CLIENT_ID= # AI-Core Client ID.
AICORE_CLIENT_SECRET= # AI-Core Client Secret.
AICORE_RESOURCE_GROUP= # AI-Core Resource Group.

VALIDATION_DATA_PATH= # Optional: Path to the validation data folder, default is ./data
MODEL_CONFIG_PATH= # Optional: Path to the model config file, default is ./config/validation/models.yml
```

3. Run the following command to set up the environment variables in your system:
3. Run the following command to set up `CONFIG_PATH` environment variable in your system:

```bash
export $(xargs < .env.validation)
export CONFIG_PATH=<path_to_config-validation.json>
```

4. Run the validation:

```bash
poetry run python src/run_validation.py
# OR
poetry shell
python src/run_validation.py
```
21 changes: 3 additions & 18 deletions tests/integration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,32 +16,17 @@ To run the Integration tests, follow these steps:
poetry install
```

2. Prepare the `.env.test` file based on the following template:
2. Prepare the `config-integration.json` file based on the [template](../../config/config-example.json).

```
LOG_LEVEL= # Allowed values: "INFO", "DEBUG", "ERROR", "WARNING"
TEST_CLUSTER_URL= # Kubernetes Cluster (with test-cases configured) URL.
TEST_CLUSTER_CA_DATA= # Kubernetes Cluster (with test-cases configured) Certificate Authority Data.
TEST_CLUSTER_AUTH_TOKEN= # Kubernetes Cluster (with test-cases configured) Authentication Token.
AICORE_AUTH_URL= # AI-Core Auth URL.
AICORE_BASE_URL= # AI-Core Base URL.
AICORE_CLIENT_ID= # AI-Core Client ID.
AICORE_CLIENT_SECRET= # AI-Core Client Secret.
AICORE_RESOURCE_GROUP= # AI-Core Resource Group.
```

3. Run the following command to set up the environment variables in your system:
3. Run the following command to set up `CONFIG_PATH` environment variable in your system:

```bash
export $(xargs < .env.test)
export CONFIG_PATH=<path_to_config-integration.json>
```

4. Run the integration tests:

```bash
poetry run poe test-integration
# OR
poetry shell
poe test-integration
```

0 comments on commit ce2e438

Please sign in to comment.