MulaiMulai sekarang secara gratis

Creating the text-to-query prompt

Latihan ini adalah bagian dari kursus

Text-to-Query Agents with MongoDB and LangGraph

Lihat Kursus

Petunjuk latihan

  • Import and preview the prebuilt MONGODB_AGENT_SYSTEM_PROMPT to get a feel for the instructions.
  • Define a prompt template containing MONGODB_AGENT_SYSTEM_PROMPT to instruct the text-to-query agent on how to use the tools provided; pre-fill the top_k and tool_names parameter.
  • Bind the tools with the OpenAI LLM, llm.
  • Chain the prompt to the tool_augmented_llm using the | operator, and invoke it on the input provided.


Note: If you’re running DataLab in Restricted Mode, this exercise isn’t supported yet. We’re actively working on making it available in the future.


Latihan interaktif praktis

Ubah teori menjadi tindakan dengan salah satu latihan interaktif kami.

Mulai berolahraga