Skip to content

Commit

Permalink
Merge pull request #52 from patched-codes/generatereadme-GenerateEmbe…
Browse files Browse the repository at this point in the history
…ddingsresolve-issue-patchflow

PatchWork GenerateREADME
  • Loading branch information
codelion authored Apr 29, 2024
2 parents 94a4697 + 8420c76 commit ebcf7b2
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions patchwork/steps/GenerateEmbeddings/README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
## `patchwork/steps/GenerateEmbeddings/GenerateEmbeddings.py`
# Summary of `GenerateEmbeddings.py`

### Inputs:
- `inputs` dictionary with keys `"embedding_name"` and `"documents"`.
## Inputs:
- The code imports necessary modules and functions.
- Defines a function `filter_by_extension` to filter files by their extensions.
- Defines a function `split_text` to split a document text into chunks.
- Creates a class `GenerateEmbeddings` that inherits from `Step`.
- Constructor `__init__` initializes the class instance with required data.
- Method `run` processes documents for embedding generation.

### Code:
- Defines `filter_by_extension` function to filter files by extension.
- Defines `split_text` function to chunk text based on given parameters.
- Class `GenerateEmbeddings(Step)` inheriting from `Step`.
- Checks for required keys in the input dictionary.
- Initializes the step with input data and sets up a client connection to a vector database.
- Runs the step by processing documents and embeddings, splitting document texts if needed, and upserting data into the vector database.

### Outputs:
## Outputs:
- The `GenerateEmbeddings` class processes document texts and embeddings, generates embeddings, and saves them to a database collection.
- Returns an empty dictionary.

## `patchwork/steps/GenerateEmbeddings/__init__.py`

- Empty file.
## Usage:
1. Import the `GenerateEmbeddings` class from the module.
2. Create an instance of `GenerateEmbeddings` with the required input dictionary.
3. Call the `run` method to generate embeddings for the provided documents and store them in the database collection.
4. Receive the output dictionary indicating the completion of the embeddings generation process.

0 comments on commit ebcf7b2

Please sign in to comment.