Refactor imports and update function names

This commit is contained in:
Gabriel Luiz Freitas Almeida 2024-01-25 16:17:40 -03:00
commit abe4925cc3
8 changed files with 156 additions and 314 deletions

View file

@ -1,6 +1,5 @@
from fastapi.testclient import TestClient
# def test_chains_settings(client: TestClient, logged_in_headers):
# response = client.get("api/v1/all", headers=logged_in_headers)
# assert response.status_code == 200
@ -18,13 +17,7 @@ def test_conversation_chain(client: TestClient, logged_in_headers):
chain = chains["ConversationChain"]
# Test the base classes, template, memory, verbose, llm, input_key, output_key, and _type objects
assert set(chain["base_classes"]) == {
"ConversationChain",
"LLMChain",
"Chain",
"function",
"Text",
}
assert set(chain["base_classes"]) == {"Callable", "Chain"}
template = chain["template"]
assert template["memory"] == {
@ -97,10 +90,7 @@ def test_conversation_chain(client: TestClient, logged_in_headers):
assert template["_type"] == "ConversationChain"
# Test the description object
assert (
chain["description"]
== "Chain to have a conversation and load context from memory."
)
assert chain["description"] == "Chain to have a conversation and load context from memory."
def test_llm_chain(client: TestClient, logged_in_headers):
@ -287,10 +277,7 @@ def test_llm_math_chain(client: TestClient, logged_in_headers):
assert template["_type"] == "LLMMathChain"
# Test the description object
assert (
chain["description"]
== "Chain that interprets a prompt and executes python code to do math."
)
assert chain["description"] == "Chain that interprets a prompt and executes python code to do math."
def test_series_character_chain(client: TestClient, logged_in_headers):
@ -396,10 +383,7 @@ def test_mid_journey_prompt_chain(client: TestClient, logged_in_headers):
"info": "",
}
# Test the description object
assert (
chain["description"]
== "MidJourneyPromptChain is a chain you can use to generate new MidJourney prompts."
)
assert chain["description"] == "MidJourneyPromptChain is a chain you can use to generate new MidJourney prompts."
def test_time_travel_guide_chain(client: TestClient, logged_in_headers):