Fix various issues and refactor code (#1647)

* Add options field to FIELD_FORMAT_ATTRIBUTES constant and import pathlib in test_initial_setup.py

* Update TEXT_FILE_TYPES in utils.py and handle missing file path error in Vertex class

* Fix tweak value assignment in process.py and clear session cache in test_process.py

* New lock

* Update repository URLs and fix file paths in code blocks

* Fix data retrieval in test_pickle_graph and test_pickle_each_vertex in test_graph.py

* Refactor load_starter_projects function to include type hinting in setup.py

* Update name of Basic Prompting (Hello, world!) project to Basic Prompting (Hello, World)

* Refactor Graph.process() method to accept start_component_id parameter

* Refactor test_endpoints.py to use "Chat Output" instead of "Prompt Output" and "ChatOutput" instead of "TextOutput"
This commit is contained in:
Gabriel Luiz Freitas Almeida 2024-04-09 01:02:56 -03:00 • committed by GitHub
commit 254f11485e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 3452 additions and 3430 deletions

View file

@ -409,7 +409,7 @@ def test_update_source_handle():
@pytest.mark.asyncio
async def test_pickle_graph(json_vector_store):
starter_projects = load_starter_projects()
data = starter_projects[0]["data"]
data = starter_projects[0][1]["data"]
graph = Graph.from_payload(data)
assert isinstance(graph, Graph)
pickled = pickle.dumps(graph)
@ -421,7 +421,7 @@ async def test_pickle_graph(json_vector_store):
@pytest.mark.asyncio
async def test_pickle_each_vertex(json_vector_store):
starter_projects = load_starter_projects()
data = starter_projects[0]["data"]
data = starter_projects[0][1]["data"]
graph = Graph.from_payload(data)
assert isinstance(graph, Graph)
for vertex in graph.vertices:
@ -430,15 +430,3 @@ async def test_pickle_each_vertex(json_vector_store):
assert pickled is not None
unpickled = pickle.loads(pickled)
assert unpickled is not None
@pytest.mark.asyncio
async def test_build_ordering(complex_graph_with_groups):
sorted_vertices = complex_graph_with_groups.sort_vertices(stop_component_id="ChatInput-Ay8QQ")
assert sorted_vertices == [
"ChatInput-Ay8QQ",
"RecordsAsText-vkx2A",
"FileLoader-Vo1Cq",
]
sorted_vertices = complex_graph_with_groups.sort_vertices()