-
-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #389 from kreneskyp/knowledge_fix
Fixing Knowledge agent:
- Loading branch information
Showing
3 changed files
with
71 additions
and
22 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
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,26 @@ | ||
import pytest | ||
from langchain_core.messages import AIMessage | ||
|
||
from ix.chains.loaders.core import ainit_chain_flow | ||
from ix.chains.models import Chain | ||
from ix.conftest import aload_fixture | ||
|
||
|
||
@pytest.mark.openai_api | ||
@pytest.mark.django_db | ||
class TestKnowledge: | ||
""" | ||
Tests for Knowledge agent. | ||
""" | ||
|
||
async def test_knowledge_flow(self, anode_types, aix_context): | ||
"""test loading the knowledge agent""" | ||
|
||
await aload_fixture("agent/knowledge") | ||
chain = await Chain.objects.aget(agent__alias="knowledge") | ||
|
||
# init flow | ||
runnable = await ainit_chain_flow(chain, context=aix_context) | ||
|
||
output = await runnable.ainvoke(input={"user_input": "test"}) | ||
assert isinstance(output, AIMessage) |