From 4bff5408d870249271d69f4c7f4e82634e61a3d6 Mon Sep 17 00:00:00 2001 From: Jesse R Weigel Date: Fri, 11 Apr 2025 09:14:05 -0400 Subject: [PATCH 1/2] Create output folder if it doesn't exits (#2573) When running this project, I got an error because the output folder had not been created. I added a line to check if the output folder exists and create it if needed. --- docs/guides/flows/first-flow.mdx | 4 ++++ 1 file changed, 4 insertions(+) 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) From 0cd524af86e3e6b3abdd6b5157196c8efc9b4f4f Mon Sep 17 00:00:00 2001 From: Cypher Pepe <125112044+cypherpepe@users.noreply.github.com> Date: Fri, 11 Apr 2025 18:58:01 +0300 Subject: [PATCH 2/2] fixed broken link in `docs/tools/weaviatevectorsearchtool.mdx` (#2569) --- docs/tools/weaviatevectorsearchtool.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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.