mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-10 08:38:30 +00:00
Merge branch 'main' into feat/trace-ui-exec-3
This commit is contained in:
@@ -263,6 +263,7 @@ Let's create our flow in the `main.py` file:
|
|||||||
```python
|
```python
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
import json
|
import json
|
||||||
|
import os
|
||||||
from typing import List, Dict
|
from typing import List, Dict
|
||||||
from pydantic import BaseModel, Field
|
from pydantic import BaseModel, Field
|
||||||
from crewai import LLM
|
from crewai import LLM
|
||||||
@@ -341,6 +342,9 @@ class GuideCreatorFlow(Flow[GuideCreatorState]):
|
|||||||
outline_dict = json.loads(response)
|
outline_dict = json.loads(response)
|
||||||
self.state.guide_outline = GuideOutline(**outline_dict)
|
self.state.guide_outline = GuideOutline(**outline_dict)
|
||||||
|
|
||||||
|
# Ensure output directory exists before saving
|
||||||
|
os.makedirs("output", exist_ok=True)
|
||||||
|
|
||||||
# Save the outline to a file
|
# Save the outline to a file
|
||||||
with open("output/guide_outline.json", "w") as f:
|
with open("output/guide_outline.json", "w") as f:
|
||||||
json.dump(outline_dict, f, indent=2)
|
json.dump(outline_dict, f, indent=2)
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ uv add weaviate-client
|
|||||||
To effectively use the `WeaviateVectorSearchTool`, follow these steps:
|
To effectively use the `WeaviateVectorSearchTool`, follow these steps:
|
||||||
|
|
||||||
1. **Package Installation**: Confirm that the `crewai[tools]` and `weaviate-client` packages are installed in your Python environment.
|
1. **Package Installation**: Confirm that the `crewai[tools]` and `weaviate-client` packages are installed in your Python environment.
|
||||||
2. **Weaviate Setup**: Set up a Weaviate cluster. You can follow the [Weaviate documentation](https://weaviate.io/developers/wcs/connect) for instructions.
|
2. **Weaviate Setup**: Set up a Weaviate cluster. You can follow the [Weaviate documentation](https://weaviate.io/developers/wcs/manage-clusters/connect) for instructions.
|
||||||
3. **API Keys**: Obtain your Weaviate cluster URL and API key.
|
3. **API Keys**: Obtain your Weaviate cluster URL and API key.
|
||||||
4. **OpenAI API Key**: Ensure you have an OpenAI API key set in your environment variables as `OPENAI_API_KEY`.
|
4. **OpenAI API Key**: Ensure you have an OpenAI API key set in your environment variables as `OPENAI_API_KEY`.
|
||||||
|
|
||||||
@@ -161,4 +161,4 @@ rag_agent = Agent(
|
|||||||
|
|
||||||
## Conclusion
|
## Conclusion
|
||||||
|
|
||||||
The `WeaviateVectorSearchTool` provides a powerful way to search for semantically similar documents in a Weaviate vector database. By leveraging vector embeddings, it enables more accurate and contextually relevant search results compared to traditional keyword-based searches. This tool is particularly useful for applications that require finding information based on meaning rather than exact matches.
|
The `WeaviateVectorSearchTool` provides a powerful way to search for semantically similar documents in a Weaviate vector database. By leveraging vector embeddings, it enables more accurate and contextually relevant search results compared to traditional keyword-based searches. This tool is particularly useful for applications that require finding information based on meaning rather than exact matches.
|
||||||
|
|||||||
Reference in New Issue
Block a user