test with a simple file

This commit is contained in:
Vasilije 2024-05-18 16:46:15 +02:00
parent 57e3e2ef90
commit 48d21c409a
2 changed files with 46 additions and 33 deletions

View file

@ -238,14 +238,27 @@ if __name__ == "__main__":
# #
# await add("data://" +data_directory_path, "example") # await add("data://" +data_directory_path, "example")
text = """import subprocess
def show_all_processes():
process = subprocess.Popen(['ps', 'aux'], stdout=subprocess.PIPE)
output, error = process.communicate()
if error:
print(f"Error: {error}")
else:
print(output.decode())
show_all_processes()"""
from cognee.api.v1.add import add
await add([text], "example_dataset")
infrastructure_config.set_config( {"chunk_engine": LangchainChunkEngine() , "chunk_strategy": ChunkStrategy.CODE,'embedding_engine': LiteLLMEmbeddingEngine() }) infrastructure_config.set_config( {"chunk_engine": LangchainChunkEngine() , "chunk_strategy": ChunkStrategy.CODE,'embedding_engine': LiteLLMEmbeddingEngine() })
from cognee.shared.SourceCodeGraph import SourceCodeGraph from cognee.shared.SourceCodeGraph import SourceCodeGraph
from cognee.api.v1.config import config from cognee.api.v1.config import config
config.set_graph_model(SourceCodeGraph) config.set_graph_model(SourceCodeGraph)
config.set_classification_model(CodeContentPrediction) config.set_classification_model(CodeContentPrediction)
graph = await cognify() graph = await cognify()

View file

@ -77,7 +77,7 @@ if __name__ == "__main__":
# #
# await add("data://" +data_directory_path, "example") # await add("data://" +data_directory_path, "example")
graph = await add_topology() # graph = await add_topology()
graph_db_type = infrastructure_config.get_config()["graph_engine"] graph_db_type = infrastructure_config.get_config()["graph_engine"]