🔧 chore(conftest.py): add new fixture for vector_store_grouped_json_flow to improve test coverage

🔧 chore(conftest.py): add new path for vector_store_grouped.json file to improve test coverage

🆕 feat(Vector Store): add Vector Store agent and Vector Store Info node

The Vector Store agent allows querying a Vector Store. It can be used to construct an agent from a Vector Store. The Vector Store Info node provides information about a Vector Store.

The Vector Store agent and Vector Store Info node are added to support the functionality of querying a Vector Store.

🔧 chore: update configuration options in the code
📝 docs: add information about the OpenAI API Base configuration option in the code comments

🔧 chore: update configuration for ChatOpenAI and Chroma nodes
📝 docs: update documentation for ChatOpenAI and Chroma nodes

🔧 chore(config): update OpenAIEmbeddings-YwSvx configuration options

The OpenAIEmbeddings-YwSvx configuration options have been updated to include new fields and values. This commit updates the configuration file to reflect these changes.

🔧 chore(config): update configuration options for OpenAIEmbeddings and Chroma

🔧 chore(config): update configuration options for OpenAIEmbeddings and Chroma to improve flexibility and customization

🔧 chore(config): update configuration options for RecursiveCharacterTextSplitter and WebBaseLoader
📝 docs(config): update configuration options for RecursiveCharacterTextSplitter and WebBaseLoader in documentation

🔧 chore(OpenAIEmbeddings): update OpenAIEmbeddings configuration options

The OpenAIEmbeddings node configuration options have been updated to include the following changes:
- `allowed_special` and `disallowed_special` now accept a list of values instead of a single value
- `chunk_size` now accepts an integer value
- `deployment` now accepts a string value
- `embedding_ctx_length` now accepts an integer value
- `headers` now supports multiline values
- `max_retries` now accepts an integer value
- `model` now accepts a string value
- `model_kwargs` now accepts code input
- `openai_api_base` now accepts a password input
- `openai_api_key` now accepts a password input
- `openai_api_type` now accepts a password input
- `openai_api_version` now accepts a password input
- `openai_organization` has been removed from the configuration options

🔧 chore: update OpenAIEmbeddings configuration options in the UI

The OpenAIEmbeddings configuration options in the UI have been updated to include the following changes:
- Added the `openai_organization` option to specify the OpenAI organization.
- Added the `openai_proxy` option to configure the OpenAI proxy.
- Added the `request_timeout` option to set the request timeout.
- Added the `show_progress_bar` option to control the display of progress bars.
- Added the `tiktoken_model_name` option to specify the Tiktoken model name.

These changes improve the flexibility and customization of the OpenAI embedding models.

🔧 chore: clean up unused code and remove unnecessary fields in the configuration file
📝 docs: update documentation link for the Chroma vectorstore module

🔧 fix: fix formatting issue in chunk_size field in RecursiveCharacterTextSplitter node configuration
🔧 fix: fix formatting issue in separator_type field in RecursiveCharacterTextSplitter node configuration
🔧 fix: fix formatting issue in separators field in RecursiveCharacterTextSplitter node configuration

📝 chore(vector_store_grouped.json): add vector_store_grouped.json test data file

🔀 chore(vector_store_grouped.json): add vector_store_grouped.json test data file

 test(graph.py): add test case for processing flow with grouped nodes and vector store
🔍 test(graph.py): add assertions to verify the correctness of the processed flow with grouped nodes and vector store
🔧 test(graph.py): update test case for updating template to make a deep copy of sample_nodes to keep it unchanged
This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-10-05 12:29:29 -03:00
commit 58548cc242
3 changed files with 28 additions and 0 deletions

View file

@ -35,6 +35,9 @@ def pytest_configure():
pytest.ONE_GROUPED_CHAT_EXAMPLE_PATH = (
Path(__file__).parent.absolute() / "data" / "one_group_chat.json"
)
pytest.VECTOR_STORE_GROUPED_EXAMPLE_PATH = (
Path(__file__).parent.absolute() / "data" / "vector_store_grouped.json"
)
pytest.CODE_WITH_SYNTAX_ERROR = """
def get_text():
@ -119,6 +122,12 @@ def one_grouped_chat_json_flow():
return f.read()
@pytest.fixture
def vector_store_grouped_json_flow():
with open(pytest.VECTOR_STORE_GROUPED_EXAMPLE_PATH, "r") as f:
return f.read()
@pytest.fixture(name="session")
def session_fixture():
engine = create_engine(

File diff suppressed because one or more lines are too long

View file

@ -401,6 +401,24 @@ def test_process_flow_one_group(one_grouped_chat_json_flow):
)
def test_process_flow_vector_store_grouped(vector_store_grouped_json_flow):
grouped_chat_data = json.loads(vector_store_grouped_json_flow).get("data")
nodes = grouped_chat_data["nodes"]
assert len(nodes) == 4
# There are two group nodes in this flow
# One of them is inside the other totalling 7 nodes
# 4 nodes grouped, one of these turns into 1 normal node and 1 group node
# This group node has 2 nodes inside it
processed_flow = process_flow(grouped_chat_data)
assert processed_flow is not None
processed_nodes = processed_flow["nodes"]
assert len(processed_nodes) == 7
assert isinstance(processed_flow, dict)
assert "nodes" in processed_flow
assert "edges" in processed_flow
def test_update_template(sample_template, sample_nodes):
# Making a deep copy to keep original sample_nodes unchanged
nodes_copy = copy.deepcopy(sample_nodes)