diff --git a/docs/_tmp/fine-tuned/_category_.yaml b/docs/_tmp/fine-tuned/_category_.yaml new file mode 100644 index 0000000..b8aef8d --- /dev/null +++ b/docs/_tmp/fine-tuned/_category_.yaml @@ -0,0 +1,2 @@ +label: "Fine-tuned Models" +position: 3 diff --git a/docs/_tmp/fine-tuned/index.mdx b/docs/_tmp/fine-tuned/index.mdx new file mode 100644 index 0000000..cf22298 --- /dev/null +++ b/docs/_tmp/fine-tuned/index.mdx @@ -0,0 +1,7 @@ +# Fine-tuned Models + +Datalayer fine-tunes models to support specific use-cases. + +- [Satellites](https://pypi.org/project/satellites) +- [Telescopes](https://pypi.org/project/telescopes) +- [Jupyter Earth](https://pypi.org/project/jupyter-earth) diff --git a/docs/_tmp/llama3/_category_.yaml b/docs/_tmp/llama3/_category_.yaml new file mode 100644 index 0000000..a52a57a --- /dev/null +++ b/docs/_tmp/llama3/_category_.yaml @@ -0,0 +1,2 @@ +label: "Llama3" +position: 2 diff --git a/docs/_tmp/llama3/index.mdx b/docs/_tmp/llama3/index.mdx new file mode 100644 index 0000000..d1ebab0 --- /dev/null +++ b/docs/_tmp/llama3/index.mdx @@ -0,0 +1,3 @@ +# Llama3 Model + +Llama3 Model. diff --git a/docs/docs/deployments/index.mdx b/docs/docs/deployments/index.mdx index 1e375f6..c60dc1a 100644 --- a/docs/docs/deployments/index.mdx +++ b/docs/docs/deployments/index.mdx @@ -5,7 +5,7 @@ import DocCardList from '@theme/DocCardList'; The **Deployment Modes** refer to where the agent is running as well as it capabilities. - `In-Kernel` - When installed in the Jupyter Kernel, the Agent can be requested directly. This is not the recommended way and should be used only for development purposes. -- `Out-Kernel Stateless` - The Agent can be requested thourh CLI for example. In a Stateless it is not possible to leverage the `Agent Memory` features, meaning that the agent is stateless and does not remember previous interactions. +- `Out-Kernel Stateless` - The Agent can be requested trough CLI for example. In a Stateless it is not possible to leverage the `Agent Memory` features, meaning that the agent does not remember previous interactions. - `Out-Kernel Stateful` - A separated process that is requested via e.g. REST endpoints, being able to leverage the `Agent Memory` features. diff --git a/docs/docs/deployments/out-kernel-stateful/index.mdx b/docs/docs/deployments/out-kernel-stateful/index.mdx index c390c02..388b2de 100644 --- a/docs/docs/deployments/out-kernel-stateful/index.mdx +++ b/docs/docs/deployments/out-kernel-stateful/index.mdx @@ -1,3 +1,5 @@ # Out Kernel Stateful -A separated process that is requested via e.g. REST endpoints, being able to leverage the `Agent Memory` features. +A separated process that is requested via e.g. REST endpoints. + +In this Stateful mode, it is possible to leverage the `Agent Memory` features, leveraging previous interactions. diff --git a/docs/docs/deployments/out-kernel-stateless/index.mdx b/docs/docs/deployments/out-kernel-stateless/index.mdx index bd690a6..cacf6a7 100644 --- a/docs/docs/deployments/out-kernel-stateless/index.mdx +++ b/docs/docs/deployments/out-kernel-stateless/index.mdx @@ -1,3 +1,5 @@ # Out Kernel Stateless -The Agent can be requested thourh CLI for example. In a Stateless it is not possible to leverage the `Agent Memory` features, meaning that the agent is stateless and does not remember previous interactions. +The Agent can be requested thourh CLI for example. + +In this Stateless mode, it is not possible to leverage the `Agent Memory` features, meaning that the agent is stateless and does not remember previous interactions. diff --git a/docs/docs/interactions/ask-mode/_category_.yaml b/docs/docs/interactions/ask-mode/_category_.yaml new file mode 100644 index 0000000..d718252 --- /dev/null +++ b/docs/docs/interactions/ask-mode/_category_.yaml @@ -0,0 +1,2 @@ +label: "Ask Mode" +position: 1 diff --git a/docs/docs/interactions/ask-mode/index.mdx b/docs/docs/interactions/ask-mode/index.mdx new file mode 100644 index 0000000..8d34615 --- /dev/null +++ b/docs/docs/interactions/ask-mode/index.mdx @@ -0,0 +1,3 @@ +# Ask Mode + +In a `Ask Mode`, the Agent is explicitely `requested` by the User. diff --git a/docs/docs/interactions/ask/_category_.yaml b/docs/docs/interactions/ask/_category_.yaml deleted file mode 100644 index f50cd5e..0000000 --- a/docs/docs/interactions/ask/_category_.yaml +++ /dev/null @@ -1,2 +0,0 @@ -label: "Ask" -position: 1 diff --git a/docs/docs/interactions/ask/index.mdx b/docs/docs/interactions/ask/index.mdx deleted file mode 100644 index c138bf4..0000000 --- a/docs/docs/interactions/ask/index.mdx +++ /dev/null @@ -1,3 +0,0 @@ -# Ask Interaction - -The Agent is triggered when the User requests it. diff --git a/docs/docs/interactions/controllers/_category_.yaml b/docs/docs/interactions/controllers/_category_.yaml new file mode 100644 index 0000000..1855bd2 --- /dev/null +++ b/docs/docs/interactions/controllers/_category_.yaml @@ -0,0 +1,2 @@ +label: "Controllers" +position: 5 diff --git a/docs/docs/interactions/controllers/index.mdx b/docs/docs/interactions/controllers/index.mdx new file mode 100644 index 0000000..5198dda --- /dev/null +++ b/docs/docs/interactions/controllers/index.mdx @@ -0,0 +1,3 @@ +# Controllers + +Controllers. diff --git a/docs/docs/interactions/index.mdx b/docs/docs/interactions/index.mdx index 3daafed..c9f0e5d 100644 --- a/docs/docs/interactions/index.mdx +++ b/docs/docs/interactions/index.mdx @@ -4,7 +4,14 @@ import DocCardList from '@theme/DocCardList'; The **interaction modes** refer to how the agent is used. -- `Ask` - The Agent is triggered when the User requests it. -- `Listen` - The Agent "observes" the Notebook an Kernels events in the background and is triggered when a specific event occurs. +- [`Ask Mode`](/docs/interactions/ask-mode) - The Agent is explicitely `requested` by the User. +- [`Listen Mode`](/docs/interactions/listen-mode) - The Agent `observes` the Notebook an Kernels events and is requested when a specific event occurs without User action. + +To interact with the Agent, you will need to. + +- Provide information via [`Inputters`](/docs/interactions/inputters) +- Retrieve the result via [`Outputters`](/docs/interactions/outputters). + +[`Controllers`](/docs/interactions/controllers) are available to ease the User interaction with the Agent. diff --git a/docs/docs/interactions/inputters/_category_.yaml b/docs/docs/interactions/inputters/_category_.yaml new file mode 100644 index 0000000..408c125 --- /dev/null +++ b/docs/docs/interactions/inputters/_category_.yaml @@ -0,0 +1,2 @@ +label: "Inputters" +position: 3 diff --git a/docs/docs/interactions/inputters/index.mdx b/docs/docs/interactions/inputters/index.mdx new file mode 100644 index 0000000..2511c44 --- /dev/null +++ b/docs/docs/interactions/inputters/index.mdx @@ -0,0 +1,8 @@ +# Inputters + +Inputters are available at various levels. + +- Cell level. +- Notebook level + +CLI level is not supported. diff --git a/docs/docs/interactions/listen-mode/_category_.yaml b/docs/docs/interactions/listen-mode/_category_.yaml new file mode 100644 index 0000000..969fc07 --- /dev/null +++ b/docs/docs/interactions/listen-mode/_category_.yaml @@ -0,0 +1,2 @@ +label: "Listen Mode" +position: 2 diff --git a/docs/docs/interactions/listen-mode/index.mdx b/docs/docs/interactions/listen-mode/index.mdx new file mode 100644 index 0000000..e20b2c0 --- /dev/null +++ b/docs/docs/interactions/listen-mode/index.mdx @@ -0,0 +1,5 @@ +# Listen Mode + +In a `Listen Mode`, the Agent `observes` the Notebook an Kernels events and is requested when a specific event occurs without User action. + +In this mode, the User need to opt-in via a [`Controllers`](/docs/interactions/controllers). diff --git a/docs/docs/interactions/listen/_category_.yaml b/docs/docs/interactions/listen/_category_.yaml deleted file mode 100644 index 25f946c..0000000 --- a/docs/docs/interactions/listen/_category_.yaml +++ /dev/null @@ -1,2 +0,0 @@ -label: "Listen" -position: 2 diff --git a/docs/docs/interactions/listen/index.mdx b/docs/docs/interactions/listen/index.mdx deleted file mode 100644 index f5efed2..0000000 --- a/docs/docs/interactions/listen/index.mdx +++ /dev/null @@ -1,3 +0,0 @@ -# Listen Interaction - -The Agent "observes" the Notebook an Kernels events in the background and is triggered when a specific event occurs. diff --git a/docs/docs/interactions/outputters/_category_.yaml b/docs/docs/interactions/outputters/_category_.yaml new file mode 100644 index 0000000..96238d2 --- /dev/null +++ b/docs/docs/interactions/outputters/_category_.yaml @@ -0,0 +1,2 @@ +label: "Outputters" +position: 4 diff --git a/docs/docs/interactions/outputters/index.mdx b/docs/docs/interactions/outputters/index.mdx new file mode 100644 index 0000000..92422f9 --- /dev/null +++ b/docs/docs/interactions/outputters/index.mdx @@ -0,0 +1,14 @@ +# Outputters + +Outputters are available at different levels. + +- Cell level. +- Notebook level + +CLI level is not supported. + +The Outputters need to provide options for the user to: + +- Accept the Outputs. +- Request execution of the Outputs. +- Request explanation of the Outputs. diff --git a/docs/docs/models/azure/_category_.yaml b/docs/docs/models/azure/_category_.yaml new file mode 100644 index 0000000..119c681 --- /dev/null +++ b/docs/docs/models/azure/_category_.yaml @@ -0,0 +1,2 @@ +label: "Azure OpenAI" +position: 1 diff --git a/docs/docs/models/azure/index.mdx b/docs/docs/models/azure/index.mdx new file mode 100644 index 0000000..b7f5090 --- /dev/null +++ b/docs/docs/models/azure/index.mdx @@ -0,0 +1,13 @@ +# Azure + +## Azure OpenAI + +Jupyter AI Agent supports models from [Azure OpenAI](https://azure.microsoft.com/en-us/products/ai-services/openai-service). + +Read the [Azure Documentation](https://learn.microsoft.com/en-us/azure/ai-services/openai) to get the needed credentials and make sure you define them in the following environment variables. + +```bash +export OPENAI_API_VERSION="..." +export AZURE_OPENAI_ENDPOINT="..." +export AZURE_OPENAI_API_KEY="..." +``` diff --git a/docs/docs/models/index.mdx b/docs/docs/models/index.mdx index 2d50552..ba2ebb6 100644 --- a/docs/docs/models/index.mdx +++ b/docs/docs/models/index.mdx @@ -1,11 +1,5 @@ -# Models - -Jupyter AI Agent currently supports models from [Azure OpenAI](https://azure.microsoft.com/en-us/products/ai-services/openai-service). +import DocCardList from '@theme/DocCardList'; -Read the [Azure Documentation](https://learn.microsoft.com/en-us/azure/ai-services/openai) to get the needed credentials and make sure you define them in the following environment variables. +# Models -```bash -export OPENAI_API_VERSION="..." -export AZURE_OPENAI_ENDPOINT="..." -export AZURE_OPENAI_API_KEY="..." -``` + diff --git a/docs/docs/tools/index.mdx b/docs/docs/tools/index.mdx index f264a01..b7d178b 100644 --- a/docs/docs/tools/index.mdx +++ b/docs/docs/tools/index.mdx @@ -2,12 +2,16 @@ The Current Tools are listed here. -- **Add Code Cell**: Dynamically add new code cells to the notebook. -- **Execute Code Cell**: Run code within specific cells, providing instant results. -- **Add Markdown Cell**: Insert markdown cells to structure and document notebooks effectively. +- **Add Code Cell** - Dynamically add new code cells to the notebook. +- **Add Markdown Cell** - Insert markdown cells to structure and document notebooks effectively. +- **Execute Code Cell** - Run code within specific cells, providing instant results. + +:::note We are implementing more Tools. -- **Modify Code Cell**: Edit existing code cells to fix errors or improve code quality. -- **Add Code Cell at a specific position**: Insert code cells at a specific location in the notebook. -- **Add Markdown Cell at a specific position**: Insert markdown cells at a specific location in the notebook. +- **Modify Code Cell** - Edit existing code cells to fix errors or improve code quality. +- **Add Code Cell at a specific position** - Insert code cells at a specific location in the notebook. +- **Add Markdown Cell at a specific position** - Insert markdown cells at a specific location in the notebook. + +::: diff --git a/jupyter_ai_agent/agents/explain_error.py b/jupyter_ai_agent/agents/explain_error.py index 9ab2be1..8978b9e 100644 --- a/jupyter_ai_agent/agents/explain_error.py +++ b/jupyter_ai_agent/agents/explain_error.py @@ -32,6 +32,7 @@ def add_code_cell(cell_content: str) -> None: """Add a Python code cell with a content to the notebook and execute it.""" return add_code_cell_tool(notebook, kernel, cell_content) + tools = [add_code_cell] cells_content_until_first_error, first_error = retrieve_cells_content_until_first_error(notebook) diff --git a/jupyter_ai_agent/agents/prompt.py b/jupyter_ai_agent/agents/prompt.py index 8d56a4b..0e59c17 100644 --- a/jupyter_ai_agent/agents/prompt.py +++ b/jupyter_ai_agent/agents/prompt.py @@ -42,7 +42,7 @@ def add_markdown_cell(cell_content: str) -> None: else: SYSTEM_PROMP_FINAL = SYSTEM_PROMPT - agent = create_azure_open_ai_agent(azure_deployment_name, SYSTEM_PROMPT, tools) + agent = create_azure_open_ai_agent(azure_deployment_name, SYSTEM_PROMP_FINAL, tools) agent_executor = AgentExecutor(agent=agent, tools=tools, verbose=True) return list(agent_executor.stream({"input": input}))