Skip to main content

Prompt Agent

The Prompt Agent generates code cells based on natural language input. It leverages AI models to generate code, markdown, add new cells, and modify the notebook content. This is a great Agent to support the following use cases:

  • Code Generation: Generate cells code based on natural language input.
  • Markdown Generation: Generate markdown cells based on natural language input.
  • Notebook Modification: Insert new cells based on existing one to your notebook.

Jupyter AI Agents

To use the Jupyter AI Agents, an easy way is to launch a CLI (update the Azure deployment based on your setup).

jupyter-ai-agents prompt \
--url http://localhost:8888 \
--token MY_TOKEN \
- model-provider azure-openai \
--model-name gpt-4o-mini \
--path test.ipynb \
--input "Create a matplotlib example"

Parameters

The Prompt Agent can be configured with the following parameters:

  • --url: JupyterLab URL.
  • --token: JupyterLab token.
  • --model-provider: azure-openai or github-copilot.
  • --model-name: Azure AI model deployment name or Github Copilot model to use.
  • --path: Notebook to modify path.
  • --input: Natural language input.
  • --full-context: Optional flag to provide the full notebook context i.e. notebook content to the AI model (default: False).
  • --current-cell-index: Optional flag to provide the index of the cell where the prompt is asked.