-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'resolve-issue-patchflow' into generatereadme-GenerateCo…
…deRepositoryEmbeddingsresolve-issue-patchflow
- Loading branch information
Showing
5 changed files
with
61 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
## `patchwork/steps/GenerateEmbeddings/GenerateEmbeddings.py` | ||
|
||
### Inputs: | ||
- `inputs` dictionary with keys `"embedding_name"` and `"documents"`. | ||
|
||
### 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: | ||
- Returns an empty dictionary. | ||
|
||
## `patchwork/steps/GenerateEmbeddings/__init__.py` | ||
|
||
- Empty file. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
## QueryEmbeddings.py | ||
|
||
### Inputs: | ||
- `inputs`: A dictionary containing keys "embedding_name" and "texts", and optional keys "top_k" and "token_limit". | ||
|
||
### Outputs: | ||
- `embedding_results`: A list of dictionaries containing document details and distances, sorted by distance. | ||
|
||
### Code: | ||
- Imports necessary modules from the project. | ||
- Defines a class `QueryEmbeddings` inheriting from `Step`. | ||
- Initializes the class with input data, identifies required keys, and sets up connection to a database. | ||
- Executes a query on input texts, filters results based on token count and distance. | ||
- Returns a sorted list of document details and distances based on the query results. | ||
|
||
This code seems to be a part of a larger project involving querying embeddings of texts and returning relevant information based on the query results. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
## Documentation: ReadIssues Step | ||
|
||
### Inputs | ||
- **Required Keys:** `issue_url` | ||
- **Optional Keys:** `github_api_key`, `gitlab_api_key`, `scm_url` | ||
- **Parameters:** | ||
- `inputs`: A dictionary containing required and optional keys for configuring the step. | ||
|
||
### Outputs | ||
- **Returns:** | ||
- A dictionary with the issue text extracted from the provided issue URL. | ||
|
||
### Description | ||
The `ReadIssues` step is a class that extends `Step` and is responsible for reading and extracting issue text from a specified issue URL on GitHub or Gitlab. It uses a SCM client based on the provided API key to access the issue information. The step filters out certain file extensions from the issues such as images and documents. The primary functionality includes initialization, checking input data, retrieving issue text, and providing the extracted issue text as output. |