Перейти к содержанию
НОВОЕМаркетплейс и trig8n Agent: продавайте то, что создали, и получайте планы и изменения, проверенные до того, как вы их увидите. Что нового

Библиотека / ИИ-агенты и ассистенты

ИИ-агенты и ассистенты

Генерация SQL-запросов по схеме MySQL с OpenAI

При запуске агент OpenAI читает только схему базы данных MySQL, чтобы писать SQL-запросы для ваших вопросов.

Что делает

### LangChain AI Agent's system prompt is modified. It uses only the database schema to generate SQL queries. The agent creates these queries but does not execute them. Instead, it passes them to subsequent nodes. Example: "Can you show me the list of all German customers?" Queries are generated only when necessary; for some requests, a query may not be needed. This is because certain questions can be answered directly without SQL execution. Example: "Can you list me all tables?"

Шаги

  1. OpenAI Chat Model
  2. Window Buffer Memory
  3. No Operation, do nothing
  4. List all tables in a database
  5. Extract database schema
  6. Add table name to output
  7. Convert data to binary
  8. Save file locally
  9. Extract data from file
  10. Chat Trigger
  11. AI Agent
  12. When clicking "Test workflow"
  13. Combine schema data and chat input
  14. Load the schema from the local file

Всего шагов: 26.

Похожие автоматизации