diff --git a/docs/guides/flows/first-flow.mdx b/docs/guides/flows/first-flow.mdx index ab03693b9..cb10de275 100644 --- a/docs/guides/flows/first-flow.mdx +++ b/docs/guides/flows/first-flow.mdx @@ -263,6 +263,7 @@ Let's create our flow in the `main.py` file: ```python #!/usr/bin/env python import json +import os from typing import List, Dict from pydantic import BaseModel, Field from crewai import LLM @@ -341,6 +342,9 @@ class GuideCreatorFlow(Flow[GuideCreatorState]): outline_dict = json.loads(response) 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 with open("output/guide_outline.json", "w") as f: json.dump(outline_dict, f, indent=2) diff --git a/docs/tools/weaviatevectorsearchtool.mdx b/docs/tools/weaviatevectorsearchtool.mdx index 53922e4e2..d17bcfef5 100644 --- a/docs/tools/weaviatevectorsearchtool.mdx +++ b/docs/tools/weaviatevectorsearchtool.mdx @@ -25,7 +25,7 @@ uv add weaviate-client 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. -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. 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 -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. \ No newline at end of file +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.