cognee 0.2.1.dev7__py3-none-any.whl → 0.2.2.dev1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- cognee/api/client.py +44 -4
- cognee/api/health.py +332 -0
- cognee/api/v1/add/add.py +5 -2
- cognee/api/v1/add/routers/get_add_router.py +3 -0
- cognee/api/v1/cognify/code_graph_pipeline.py +3 -1
- cognee/api/v1/cognify/cognify.py +8 -0
- cognee/api/v1/cognify/routers/get_cognify_router.py +8 -1
- cognee/api/v1/config/config.py +3 -1
- cognee/api/v1/datasets/routers/get_datasets_router.py +2 -8
- cognee/api/v1/delete/delete.py +16 -12
- cognee/api/v1/responses/routers/get_responses_router.py +3 -1
- cognee/api/v1/search/search.py +10 -0
- cognee/api/v1/settings/routers/get_settings_router.py +0 -2
- cognee/base_config.py +1 -0
- cognee/eval_framework/evaluation/direct_llm_eval_adapter.py +5 -6
- cognee/infrastructure/databases/graph/config.py +2 -0
- cognee/infrastructure/databases/graph/get_graph_engine.py +58 -12
- cognee/infrastructure/databases/graph/graph_db_interface.py +15 -10
- cognee/infrastructure/databases/graph/kuzu/adapter.py +43 -16
- cognee/infrastructure/databases/graph/kuzu/kuzu_migrate.py +281 -0
- cognee/infrastructure/databases/graph/neo4j_driver/adapter.py +151 -77
- cognee/infrastructure/databases/graph/neptune_driver/__init__.py +15 -0
- cognee/infrastructure/databases/graph/neptune_driver/adapter.py +1427 -0
- cognee/infrastructure/databases/graph/neptune_driver/exceptions.py +115 -0
- cognee/infrastructure/databases/graph/neptune_driver/neptune_utils.py +224 -0
- cognee/infrastructure/databases/graph/networkx/adapter.py +3 -3
- cognee/infrastructure/databases/hybrid/neptune_analytics/NeptuneAnalyticsAdapter.py +449 -0
- cognee/infrastructure/databases/relational/sqlalchemy/SqlAlchemyAdapter.py +11 -3
- cognee/infrastructure/databases/vector/chromadb/ChromaDBAdapter.py +8 -3
- cognee/infrastructure/databases/vector/create_vector_engine.py +31 -23
- cognee/infrastructure/databases/vector/embeddings/FastembedEmbeddingEngine.py +3 -1
- cognee/infrastructure/databases/vector/embeddings/LiteLLMEmbeddingEngine.py +21 -6
- cognee/infrastructure/databases/vector/embeddings/OllamaEmbeddingEngine.py +4 -3
- cognee/infrastructure/databases/vector/embeddings/get_embedding_engine.py +3 -1
- cognee/infrastructure/databases/vector/lancedb/LanceDBAdapter.py +22 -16
- cognee/infrastructure/databases/vector/pgvector/PGVectorAdapter.py +36 -34
- cognee/infrastructure/databases/vector/vector_db_interface.py +78 -7
- cognee/infrastructure/files/utils/get_data_file_path.py +39 -0
- cognee/infrastructure/files/utils/guess_file_type.py +2 -2
- cognee/infrastructure/files/utils/open_data_file.py +4 -23
- cognee/infrastructure/llm/LLMGateway.py +137 -0
- cognee/infrastructure/llm/__init__.py +14 -4
- cognee/infrastructure/llm/config.py +29 -1
- cognee/infrastructure/llm/prompts/answer_hotpot_question.txt +1 -1
- cognee/infrastructure/llm/prompts/answer_hotpot_using_cognee_search.txt +1 -1
- cognee/infrastructure/llm/prompts/answer_simple_question.txt +1 -1
- cognee/infrastructure/llm/prompts/answer_simple_question_restricted.txt +1 -1
- cognee/infrastructure/llm/prompts/categorize_categories.txt +1 -1
- cognee/infrastructure/llm/prompts/classify_content.txt +1 -1
- cognee/infrastructure/llm/prompts/context_for_question.txt +1 -1
- cognee/infrastructure/llm/prompts/graph_context_for_question.txt +1 -1
- cognee/infrastructure/llm/prompts/natural_language_retriever_system.txt +1 -1
- cognee/infrastructure/llm/prompts/patch_gen_instructions.txt +1 -1
- cognee/infrastructure/llm/prompts/search_type_selector_prompt.txt +130 -0
- cognee/infrastructure/llm/prompts/summarize_code.txt +2 -2
- cognee/infrastructure/llm/structured_output_framework/baml/baml_client/__init__.py +57 -0
- cognee/infrastructure/llm/structured_output_framework/baml/baml_client/async_client.py +533 -0
- cognee/infrastructure/llm/structured_output_framework/baml/baml_client/config.py +94 -0
- cognee/infrastructure/llm/structured_output_framework/baml/baml_client/globals.py +37 -0
- cognee/infrastructure/llm/structured_output_framework/baml/baml_client/inlinedbaml.py +21 -0
- cognee/infrastructure/llm/structured_output_framework/baml/baml_client/parser.py +131 -0
- cognee/infrastructure/llm/structured_output_framework/baml/baml_client/runtime.py +266 -0
- cognee/infrastructure/llm/structured_output_framework/baml/baml_client/stream_types.py +137 -0
- cognee/infrastructure/llm/structured_output_framework/baml/baml_client/sync_client.py +550 -0
- cognee/infrastructure/llm/structured_output_framework/baml/baml_client/tracing.py +26 -0
- cognee/infrastructure/llm/structured_output_framework/baml/baml_client/type_builder.py +962 -0
- cognee/infrastructure/llm/structured_output_framework/baml/baml_client/type_map.py +52 -0
- cognee/infrastructure/llm/structured_output_framework/baml/baml_client/types.py +166 -0
- cognee/infrastructure/llm/structured_output_framework/baml/baml_src/extract_categories.baml +109 -0
- cognee/infrastructure/llm/structured_output_framework/baml/baml_src/extract_content_graph.baml +343 -0
- cognee/{modules/data → infrastructure/llm/structured_output_framework/baml/baml_src}/extraction/__init__.py +1 -0
- cognee/infrastructure/llm/structured_output_framework/baml/baml_src/extraction/extract_summary.py +89 -0
- cognee/infrastructure/llm/structured_output_framework/baml/baml_src/extraction/knowledge_graph/extract_content_graph.py +33 -0
- cognee/infrastructure/llm/structured_output_framework/baml/baml_src/generators.baml +18 -0
- cognee/infrastructure/llm/structured_output_framework/litellm_instructor/extraction/__init__.py +3 -0
- cognee/infrastructure/llm/structured_output_framework/litellm_instructor/extraction/extract_categories.py +12 -0
- cognee/{modules/data → infrastructure/llm/structured_output_framework/litellm_instructor}/extraction/extract_summary.py +16 -7
- cognee/{modules/data → infrastructure/llm/structured_output_framework/litellm_instructor}/extraction/knowledge_graph/extract_content_graph.py +7 -6
- cognee/infrastructure/llm/{anthropic → structured_output_framework/litellm_instructor/llm/anthropic}/adapter.py +10 -4
- cognee/infrastructure/llm/{gemini → structured_output_framework/litellm_instructor/llm/gemini}/adapter.py +6 -5
- cognee/infrastructure/llm/structured_output_framework/litellm_instructor/llm/generic_llm_api/__init__.py +0 -0
- cognee/infrastructure/llm/{generic_llm_api → structured_output_framework/litellm_instructor/llm/generic_llm_api}/adapter.py +7 -3
- cognee/infrastructure/llm/{get_llm_client.py → structured_output_framework/litellm_instructor/llm/get_llm_client.py} +18 -6
- cognee/infrastructure/llm/{llm_interface.py → structured_output_framework/litellm_instructor/llm/llm_interface.py} +2 -2
- cognee/infrastructure/llm/structured_output_framework/litellm_instructor/llm/ollama/__init__.py +0 -0
- cognee/infrastructure/llm/{ollama → structured_output_framework/litellm_instructor/llm/ollama}/adapter.py +4 -2
- cognee/infrastructure/llm/structured_output_framework/litellm_instructor/llm/openai/__init__.py +0 -0
- cognee/infrastructure/llm/{openai → structured_output_framework/litellm_instructor/llm/openai}/adapter.py +6 -4
- cognee/infrastructure/llm/{rate_limiter.py → structured_output_framework/litellm_instructor/llm/rate_limiter.py} +0 -5
- cognee/infrastructure/llm/tokenizer/Gemini/adapter.py +4 -2
- cognee/infrastructure/llm/tokenizer/TikToken/adapter.py +7 -3
- cognee/infrastructure/llm/tokenizer/__init__.py +4 -0
- cognee/infrastructure/llm/utils.py +3 -1
- cognee/infrastructure/loaders/LoaderEngine.py +156 -0
- cognee/infrastructure/loaders/LoaderInterface.py +73 -0
- cognee/infrastructure/loaders/__init__.py +18 -0
- cognee/infrastructure/loaders/core/__init__.py +7 -0
- cognee/infrastructure/loaders/core/audio_loader.py +98 -0
- cognee/infrastructure/loaders/core/image_loader.py +114 -0
- cognee/infrastructure/loaders/core/text_loader.py +90 -0
- cognee/infrastructure/loaders/create_loader_engine.py +32 -0
- cognee/infrastructure/loaders/external/__init__.py +22 -0
- cognee/infrastructure/loaders/external/pypdf_loader.py +96 -0
- cognee/infrastructure/loaders/external/unstructured_loader.py +127 -0
- cognee/infrastructure/loaders/get_loader_engine.py +18 -0
- cognee/infrastructure/loaders/supported_loaders.py +18 -0
- cognee/infrastructure/loaders/use_loader.py +21 -0
- cognee/infrastructure/loaders/utils/__init__.py +0 -0
- cognee/modules/data/methods/__init__.py +1 -0
- cognee/modules/data/methods/get_authorized_dataset.py +23 -0
- cognee/modules/data/models/Data.py +13 -3
- cognee/modules/data/processing/document_types/AudioDocument.py +2 -2
- cognee/modules/data/processing/document_types/ImageDocument.py +2 -2
- cognee/modules/data/processing/document_types/PdfDocument.py +4 -11
- cognee/modules/data/processing/document_types/UnstructuredDocument.py +2 -5
- cognee/modules/engine/utils/generate_edge_id.py +5 -0
- cognee/modules/graph/cognee_graph/CogneeGraph.py +45 -35
- cognee/modules/graph/methods/get_formatted_graph_data.py +8 -2
- cognee/modules/graph/utils/get_graph_from_model.py +93 -101
- cognee/modules/ingestion/data_types/TextData.py +8 -2
- cognee/modules/ingestion/save_data_to_file.py +1 -1
- cognee/modules/pipelines/exceptions/__init__.py +1 -0
- cognee/modules/pipelines/exceptions/exceptions.py +12 -0
- cognee/modules/pipelines/models/DataItemStatus.py +5 -0
- cognee/modules/pipelines/models/PipelineRunInfo.py +6 -0
- cognee/modules/pipelines/models/__init__.py +1 -0
- cognee/modules/pipelines/operations/pipeline.py +10 -2
- cognee/modules/pipelines/operations/run_tasks.py +252 -20
- cognee/modules/pipelines/operations/run_tasks_distributed.py +1 -1
- cognee/modules/retrieval/chunks_retriever.py +23 -1
- cognee/modules/retrieval/code_retriever.py +66 -9
- cognee/modules/retrieval/completion_retriever.py +11 -9
- cognee/modules/retrieval/context_providers/TripletSearchContextProvider.py +0 -2
- cognee/modules/retrieval/graph_completion_context_extension_retriever.py +0 -2
- cognee/modules/retrieval/graph_completion_cot_retriever.py +8 -9
- cognee/modules/retrieval/graph_completion_retriever.py +1 -1
- cognee/modules/retrieval/insights_retriever.py +4 -0
- cognee/modules/retrieval/natural_language_retriever.py +9 -15
- cognee/modules/retrieval/summaries_retriever.py +23 -1
- cognee/modules/retrieval/utils/brute_force_triplet_search.py +23 -4
- cognee/modules/retrieval/utils/completion.py +6 -9
- cognee/modules/retrieval/utils/description_to_codepart_search.py +2 -3
- cognee/modules/search/methods/search.py +5 -1
- cognee/modules/search/operations/__init__.py +1 -0
- cognee/modules/search/operations/select_search_type.py +42 -0
- cognee/modules/search/types/SearchType.py +1 -0
- cognee/modules/settings/get_settings.py +0 -8
- cognee/modules/settings/save_vector_db_config.py +1 -1
- cognee/shared/data_models.py +3 -1
- cognee/shared/logging_utils.py +0 -5
- cognee/tasks/chunk_naive_llm_classifier/chunk_naive_llm_classifier.py +2 -2
- cognee/tasks/documents/extract_chunks_from_documents.py +10 -12
- cognee/tasks/entity_completion/entity_extractors/llm_entity_extractor.py +4 -6
- cognee/tasks/graph/cascade_extract/utils/extract_content_nodes_and_relationship_names.py +4 -6
- cognee/tasks/graph/cascade_extract/utils/extract_edge_triplets.py +6 -7
- cognee/tasks/graph/cascade_extract/utils/extract_nodes.py +4 -7
- cognee/tasks/graph/extract_graph_from_code.py +3 -2
- cognee/tasks/graph/extract_graph_from_data.py +4 -3
- cognee/tasks/graph/infer_data_ontology.py +5 -6
- cognee/tasks/ingestion/data_item_to_text_file.py +79 -0
- cognee/tasks/ingestion/ingest_data.py +91 -61
- cognee/tasks/ingestion/resolve_data_directories.py +3 -0
- cognee/tasks/repo_processor/get_repo_file_dependencies.py +3 -0
- cognee/tasks/storage/index_data_points.py +1 -1
- cognee/tasks/storage/index_graph_edges.py +4 -1
- cognee/tasks/summarization/summarize_code.py +2 -3
- cognee/tasks/summarization/summarize_text.py +3 -2
- cognee/tests/test_cognee_server_start.py +12 -7
- cognee/tests/test_deduplication.py +2 -2
- cognee/tests/test_deletion.py +58 -17
- cognee/tests/test_graph_visualization_permissions.py +161 -0
- cognee/tests/test_neptune_analytics_graph.py +309 -0
- cognee/tests/test_neptune_analytics_hybrid.py +176 -0
- cognee/tests/{test_weaviate.py → test_neptune_analytics_vector.py} +86 -11
- cognee/tests/test_pgvector.py +5 -5
- cognee/tests/test_s3.py +1 -6
- cognee/tests/unit/infrastructure/databases/test_rate_limiter.py +11 -10
- cognee/tests/unit/infrastructure/databases/vector/__init__.py +0 -0
- cognee/tests/unit/infrastructure/mock_embedding_engine.py +1 -1
- cognee/tests/unit/infrastructure/test_embedding_rate_limiting_realistic.py +5 -5
- cognee/tests/unit/infrastructure/test_rate_limiting_realistic.py +6 -4
- cognee/tests/unit/infrastructure/test_rate_limiting_retry.py +1 -1
- cognee/tests/unit/interfaces/graph/get_graph_from_model_unit_test.py +61 -3
- cognee/tests/unit/modules/retrieval/graph_completion_retriever_test.py +84 -9
- cognee/tests/unit/modules/search/search_methods_test.py +55 -0
- {cognee-0.2.1.dev7.dist-info → cognee-0.2.2.dev1.dist-info}/METADATA +13 -9
- {cognee-0.2.1.dev7.dist-info → cognee-0.2.2.dev1.dist-info}/RECORD +203 -164
- cognee/infrastructure/databases/vector/pinecone/adapter.py +0 -8
- cognee/infrastructure/databases/vector/qdrant/QDrantAdapter.py +0 -514
- cognee/infrastructure/databases/vector/qdrant/__init__.py +0 -2
- cognee/infrastructure/databases/vector/weaviate_db/WeaviateAdapter.py +0 -527
- cognee/infrastructure/databases/vector/weaviate_db/__init__.py +0 -1
- cognee/modules/data/extraction/extract_categories.py +0 -14
- cognee/tests/test_qdrant.py +0 -99
- distributed/Dockerfile +0 -34
- distributed/app.py +0 -4
- distributed/entrypoint.py +0 -71
- distributed/entrypoint.sh +0 -5
- distributed/modal_image.py +0 -11
- distributed/queues.py +0 -5
- distributed/tasks/queued_add_data_points.py +0 -13
- distributed/tasks/queued_add_edges.py +0 -13
- distributed/tasks/queued_add_nodes.py +0 -13
- distributed/test.py +0 -28
- distributed/utils.py +0 -19
- distributed/workers/data_point_saving_worker.py +0 -93
- distributed/workers/graph_saving_worker.py +0 -104
- /cognee/infrastructure/databases/{graph/memgraph → hybrid/neptune_analytics}/__init__.py +0 -0
- /cognee/infrastructure/{llm → databases/vector/embeddings}/embedding_rate_limiter.py +0 -0
- /cognee/infrastructure/{databases/vector/pinecone → llm/structured_output_framework}/__init__.py +0 -0
- /cognee/infrastructure/llm/{anthropic → structured_output_framework/baml/baml_src}/__init__.py +0 -0
- /cognee/infrastructure/llm/{gemini/__init__.py → structured_output_framework/baml/baml_src/extraction/extract_categories.py} +0 -0
- /cognee/infrastructure/llm/{generic_llm_api → structured_output_framework/baml/baml_src/extraction/knowledge_graph}/__init__.py +0 -0
- /cognee/infrastructure/llm/{ollama → structured_output_framework/litellm_instructor}/__init__.py +0 -0
- /cognee/{modules/data → infrastructure/llm/structured_output_framework/litellm_instructor}/extraction/knowledge_graph/__init__.py +0 -0
- /cognee/{modules/data → infrastructure/llm/structured_output_framework/litellm_instructor}/extraction/texts.json +0 -0
- /cognee/infrastructure/llm/{openai → structured_output_framework/litellm_instructor/llm}/__init__.py +0 -0
- {distributed → cognee/infrastructure/llm/structured_output_framework/litellm_instructor/llm/anthropic}/__init__.py +0 -0
- {distributed/tasks → cognee/infrastructure/llm/structured_output_framework/litellm_instructor/llm/gemini}/__init__.py +0 -0
- /cognee/modules/data/{extraction/knowledge_graph → methods}/add_model_class_to_graph.py +0 -0
- {cognee-0.2.1.dev7.dist-info → cognee-0.2.2.dev1.dist-info}/WHEEL +0 -0
- {cognee-0.2.1.dev7.dist-info → cognee-0.2.2.dev1.dist-info}/licenses/LICENSE +0 -0
- {cognee-0.2.1.dev7.dist-info → cognee-0.2.2.dev1.dist-info}/licenses/NOTICE.md +0 -0
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
You are an expert query analyzer for a **GraphRAG system**. Your primary goal is to analyze a user's query and select the single most appropriate `SearchType` tool to answer it.
|
|
2
|
+
|
|
3
|
+
Here are the available `SearchType` tools and their specific functions:
|
|
4
|
+
|
|
5
|
+
- **`SUMMARIES`**: The `SUMMARIES` search type retrieves summarized information from the knowledge graph.
|
|
6
|
+
|
|
7
|
+
**Best for:**
|
|
8
|
+
|
|
9
|
+
- Getting concise overviews of topics
|
|
10
|
+
- Summarizing large amounts of information
|
|
11
|
+
- Quick understanding of complex subjects
|
|
12
|
+
|
|
13
|
+
* **`INSIGHTS`**: The `INSIGHTS` search type discovers connections and relationships between entities in the knowledge graph.
|
|
14
|
+
|
|
15
|
+
**Best for:**
|
|
16
|
+
|
|
17
|
+
- Discovering how entities are connected
|
|
18
|
+
- Understanding relationships between concepts
|
|
19
|
+
- Exploring the structure of your knowledge graph
|
|
20
|
+
|
|
21
|
+
* **`CHUNKS`**: The `CHUNKS` search type retrieves specific facts and information chunks from the knowledge graph.
|
|
22
|
+
|
|
23
|
+
**Best for:**
|
|
24
|
+
|
|
25
|
+
- Finding specific facts
|
|
26
|
+
- Getting direct answers to questions
|
|
27
|
+
- Retrieving precise information
|
|
28
|
+
|
|
29
|
+
* **`RAG_COMPLETION`**: Use for direct factual questions that can likely be answered by retrieving a specific text passage from a document. It does not use the graph's relationship structure.
|
|
30
|
+
|
|
31
|
+
**Best for:**
|
|
32
|
+
|
|
33
|
+
- Getting detailed explanations or comprehensive answers
|
|
34
|
+
- Combining multiple pieces of information
|
|
35
|
+
- Getting a single, coherent answer that is generated from relevant text passages
|
|
36
|
+
|
|
37
|
+
* **`GRAPH_COMPLETION`**: The `GRAPH_COMPLETION` search type leverages the graph structure to provide more contextually aware completions.
|
|
38
|
+
|
|
39
|
+
**Best for:**
|
|
40
|
+
|
|
41
|
+
- Complex queries requiring graph traversal
|
|
42
|
+
- Questions that benefit from understanding relationships
|
|
43
|
+
- Queries where context from connected entities matters
|
|
44
|
+
|
|
45
|
+
* **`GRAPH_SUMMARY_COMPLETION`**: The `GRAPH_SUMMARY_COMPLETION` search type combines graph traversal with summarization to provide concise but comprehensive answers.
|
|
46
|
+
|
|
47
|
+
**Best for:**
|
|
48
|
+
|
|
49
|
+
- Getting summarized information that requires understanding relationships
|
|
50
|
+
- Complex topics that need concise explanations
|
|
51
|
+
- Queries that benefit from both graph structure and summarization
|
|
52
|
+
|
|
53
|
+
* **`GRAPH_COMPLETION_COT`**: The `GRAPH_COMPLETION_COT` search type combines graph traversal with chain of thought to provide answers to complex multi hop questions.
|
|
54
|
+
|
|
55
|
+
**Best for:**
|
|
56
|
+
|
|
57
|
+
- Multi-hop questions that require following several linked concepts or entities
|
|
58
|
+
- Tracing relational paths in a knowledge graph while also getting clear step-by-step reasoning
|
|
59
|
+
- Summarizing completx linkages into a concise, human-readable answer once all hops have been explored
|
|
60
|
+
|
|
61
|
+
* **`GRAPH_COMPLETION_CONTEXT_EXTENSION`**: The `GRAPH_COMPLETION_CONTEXT_EXTENSION` search type combines graph traversal with multi-round context extension.
|
|
62
|
+
|
|
63
|
+
**Best for:**
|
|
64
|
+
|
|
65
|
+
- Iterative, multi-hop queries where intermediate facts aren’t all present upfront
|
|
66
|
+
- Complex linkages that benefit from multi-round “search → extend context → reason” loops to uncover deep connections.
|
|
67
|
+
- Sparse or evolving graphs that require on-the-fly expansion—issuing follow-up searches to discover missing nodes or properties
|
|
68
|
+
|
|
69
|
+
* **`CODE`**: The `CODE` search type is specialized for retrieving and understanding code-related information from the knowledge graph.
|
|
70
|
+
|
|
71
|
+
**Best for:**
|
|
72
|
+
|
|
73
|
+
- Code-related queries
|
|
74
|
+
- Programming examples and patterns
|
|
75
|
+
- Technical documentation searches
|
|
76
|
+
|
|
77
|
+
* **`CYPHER`**: The `CYPHER` search type allows user to execute raw Cypher queries directly against your graph database.
|
|
78
|
+
|
|
79
|
+
**Best for:**
|
|
80
|
+
|
|
81
|
+
- Executing precise graph queries with full control
|
|
82
|
+
- Leveraging Cypher features and functions
|
|
83
|
+
- Getting raw data directly from the graph database
|
|
84
|
+
|
|
85
|
+
* **`NATURAL_LANGUAGE`**: The `NATURAL_LANGUAGE` search type translates a natural language question into a precise Cypher query that is executed directly against the graph database.
|
|
86
|
+
|
|
87
|
+
**Best for:**
|
|
88
|
+
|
|
89
|
+
- Getting precise, structured answers from the graph using natural language.
|
|
90
|
+
- Performing advanced graph operations like filtering and aggregating data using natural language.
|
|
91
|
+
- Asking precise, database-style questions without needing to write Cypher.
|
|
92
|
+
|
|
93
|
+
**Examples:**
|
|
94
|
+
|
|
95
|
+
Query: "Summarize the key findings from these research papers"
|
|
96
|
+
Response: `SUMMARIES`
|
|
97
|
+
|
|
98
|
+
Query: "What is the relationship between the methodologies used in these papers?"
|
|
99
|
+
Response: `INSIGHTS`
|
|
100
|
+
|
|
101
|
+
Query: "When was Einstein born?"
|
|
102
|
+
Response: `CHUNKS`
|
|
103
|
+
|
|
104
|
+
Query: "Explain Einstein's contributions to physics"
|
|
105
|
+
Response: `RAG_COMPLETION`
|
|
106
|
+
|
|
107
|
+
Query: "Provide a comprehensive analysis of how these papers contribute to the field"
|
|
108
|
+
Response: `GRAPH_COMPLETION`
|
|
109
|
+
|
|
110
|
+
Query: "Explain the overall architecture of this codebase"
|
|
111
|
+
Response: `GRAPH_SUMMARY_COMPLETION`
|
|
112
|
+
|
|
113
|
+
Query: "Who was the father of the person who invented the lightbulb"
|
|
114
|
+
Response: `GRAPH_COMPLETION_COT`
|
|
115
|
+
|
|
116
|
+
Query: "What county was XY born in"
|
|
117
|
+
Response: `GRAPH_COMPLETION_CONTEXT_EXTENSION`
|
|
118
|
+
|
|
119
|
+
Query: "How to implement authentication in this codebase"
|
|
120
|
+
Response: `CODE`
|
|
121
|
+
|
|
122
|
+
Query: "MATCH (n) RETURN labels(n) as types, n.name as name LIMIT 10"
|
|
123
|
+
Response: `CYPHER`
|
|
124
|
+
|
|
125
|
+
Query: "Get all nodes connected to John"
|
|
126
|
+
Response: `NATURAL_LANGUAGE`
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
Your response MUST be a single word, consisting of only the chosen `SearchType` name. Do not provide any explanation.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
You are an expert Python programmer and technical writer. Your task is to summarize the given Python code snippet or file.
|
|
2
|
-
The code may contain multiple imports, classes, functions, constants and logic. Provide a clear, structured explanation of its components
|
|
2
|
+
The code may contain multiple imports, classes, functions, constants and logic. Provide a clear, structured explanation of its components
|
|
3
3
|
and their relationships.
|
|
4
4
|
|
|
5
5
|
Instructions:
|
|
@@ -7,4 +7,4 @@ Provide an overview: Start with a high-level summary of what the code does as a
|
|
|
7
7
|
Break it down: Summarize each class and function individually, explaining their purpose and how they interact.
|
|
8
8
|
Describe the workflow: Outline how the classes and functions work together. Mention any control flow (e.g., main functions, entry points, loops).
|
|
9
9
|
Key features: Highlight important elements like arguments, return values, or unique logic.
|
|
10
|
-
Maintain clarity: Write in plain English for someone familiar with Python but unfamiliar with this code.
|
|
10
|
+
Maintain clarity: Write in plain English for someone familiar with Python but unfamiliar with this code.
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# ----------------------------------------------------------------------------
|
|
2
|
+
#
|
|
3
|
+
# Welcome to Baml! To use this generated code, please run the following:
|
|
4
|
+
#
|
|
5
|
+
# $ pip install baml
|
|
6
|
+
#
|
|
7
|
+
# ----------------------------------------------------------------------------
|
|
8
|
+
|
|
9
|
+
# This file was generated by BAML: please do not edit it. Instead, edit the
|
|
10
|
+
# BAML files and re-generate this code using: baml-cli generate
|
|
11
|
+
# baml-cli is available with the baml package.
|
|
12
|
+
|
|
13
|
+
__version__ = "0.201.0"
|
|
14
|
+
|
|
15
|
+
try:
|
|
16
|
+
from baml_py.safe_import import EnsureBamlPyImport
|
|
17
|
+
except ImportError:
|
|
18
|
+
raise ImportError(f"""Update to baml-py required.
|
|
19
|
+
Version of baml_client generator (see generators.baml): {__version__}
|
|
20
|
+
|
|
21
|
+
Please upgrade baml-py to version "{__version__}".
|
|
22
|
+
|
|
23
|
+
$ pip install baml-py=={__version__}
|
|
24
|
+
$ uv add baml-py=={__version__}
|
|
25
|
+
|
|
26
|
+
If nothing else works, please ask for help:
|
|
27
|
+
|
|
28
|
+
https://github.com/boundaryml/baml/issues
|
|
29
|
+
https://boundaryml.com/discord
|
|
30
|
+
""") from None
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
with EnsureBamlPyImport(__version__) as e:
|
|
34
|
+
e.raise_if_incompatible_version(__version__)
|
|
35
|
+
|
|
36
|
+
from . import types
|
|
37
|
+
from . import tracing
|
|
38
|
+
from . import stream_types
|
|
39
|
+
from . import config
|
|
40
|
+
from .config import reset_baml_env_vars
|
|
41
|
+
|
|
42
|
+
from .sync_client import b
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
# FOR LEGACY COMPATIBILITY, expose "partial_types" as an alias for "stream_types"
|
|
46
|
+
# WE RECOMMEND USERS TO USE "stream_types" INSTEAD
|
|
47
|
+
partial_types = stream_types
|
|
48
|
+
|
|
49
|
+
__all__ = [
|
|
50
|
+
"b",
|
|
51
|
+
"stream_types",
|
|
52
|
+
"partial_types",
|
|
53
|
+
"tracing",
|
|
54
|
+
"types",
|
|
55
|
+
"reset_baml_env_vars",
|
|
56
|
+
"config",
|
|
57
|
+
]
|