mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-07-26 09:15:08 +00:00
[docs-freeze] docs: snapshot and changelog for v1.15.4 (#6583)
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Check Documentation Broken Links / Check broken links (push) Has been cancelled
Vulnerability Scan / pip-audit (push) Has been cancelled
Nightly Canary Release / Check for new commits (push) Has been cancelled
Nightly Canary Release / Build nightly packages (push) Has been cancelled
Nightly Canary Release / Publish nightly to PyPI (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Check Documentation Broken Links / Check broken links (push) Has been cancelled
Vulnerability Scan / pip-audit (push) Has been cancelled
Nightly Canary Release / Check for new commits (push) Has been cancelled
Nightly Canary Release / Build nightly packages (push) Has been cancelled
Nightly Canary Release / Publish nightly to PyPI (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
This commit is contained in:
70
docs/v1.15.4/en/tools/database-data/mysqltool.mdx
Normal file
70
docs/v1.15.4/en/tools/database-data/mysqltool.mdx
Normal file
@@ -0,0 +1,70 @@
|
||||
---
|
||||
title: MySQL RAG Search
|
||||
description: The `MySQLSearchTool` is designed to search MySQL databases and return the most relevant results.
|
||||
icon: database
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
This tool is designed to facilitate semantic searches within MySQL database tables. Leveraging the RAG (Retrieve and Generate) technology,
|
||||
the MySQLSearchTool provides users with an efficient means of querying database table content, specifically tailored for MySQL databases.
|
||||
It simplifies the process of finding relevant data through semantic search queries, making it an invaluable resource for users needing
|
||||
to perform advanced queries on extensive datasets within a MySQL database.
|
||||
|
||||
## Installation
|
||||
|
||||
To install the `crewai_tools` package and utilize the MySQLSearchTool, execute the following command in your terminal:
|
||||
|
||||
```shell
|
||||
pip install 'crewai[tools]'
|
||||
```
|
||||
|
||||
## Example
|
||||
|
||||
Below is an example showcasing how to use the MySQLSearchTool to conduct a semantic search on a table within a MySQL database:
|
||||
|
||||
```python Code
|
||||
from crewai_tools import MySQLSearchTool
|
||||
|
||||
# Initialize the tool with the database URI and the target table name
|
||||
tool = MySQLSearchTool(
|
||||
db_uri='mysql://user:password@localhost:3306/mydatabase',
|
||||
table_name='employees'
|
||||
)
|
||||
```
|
||||
|
||||
## Arguments
|
||||
|
||||
The MySQLSearchTool requires the following arguments for its operation:
|
||||
|
||||
- `db_uri`: A string representing the URI of the MySQL database to be queried. This argument is mandatory and must include the necessary authentication details and the location of the database.
|
||||
- `table_name`: A string specifying the name of the table within the database on which the semantic search will be performed. This argument is mandatory.
|
||||
|
||||
## Custom model and embeddings
|
||||
|
||||
By default, the tool uses OpenAI for both embeddings and summarization. To customize the model, you can use a config dictionary as follows:
|
||||
|
||||
```python Code
|
||||
tool = MySQLSearchTool(
|
||||
config=dict(
|
||||
llm=dict(
|
||||
provider="ollama", # or google, openai, anthropic, llama2, ...
|
||||
config=dict(
|
||||
model="llama2",
|
||||
# temperature=0.5,
|
||||
# top_p=1,
|
||||
# stream=true,
|
||||
),
|
||||
),
|
||||
embedder=dict(
|
||||
provider="google-generativeai",
|
||||
config=dict(
|
||||
model_name="gemini-embedding-001",
|
||||
task_type="RETRIEVAL_DOCUMENT",
|
||||
# title="Embeddings",
|
||||
),
|
||||
),
|
||||
)
|
||||
)
|
||||
```
|
||||
Reference in New Issue
Block a user