BaşlayınÜcretsiz Başlayın

A text-to-query workflow in practice

Bu egzersiz

Text-to-Query Agents with MongoDB and LangGraph

kursunun bir parçasıdır
Kursu Görüntüle

Egzersiz talimatları

  • Initialize an OpenAI LLM with appropriate temperature value using LangChain's ChatOpenAI class.
  • Convert the natural language query provided into a MongoDB query, execute it, and obtain the results as a Python list.
  • Create a prompt template for the LLM, consisting of a system prompt and a placeholder for messages, using the .from_messages() method.
  • Chain the prompt with the LLM using the | operator, and invoke it on the query results (docs) and the user query (user_query).


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.


Uygulamalı interaktif egzersiz

İnteraktif egzersizlerimizden biriyle teoriyi pratiğe dökün

Egzersizi başlat