Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AI assistant draft docs #570

Merged
merged 10 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 76 additions & 0 deletions docs/build/ai-assistant.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
---
title: Using the AI Assistant
sidebar_label: AI Assistant
---

The OpenFn AI Assistant provides a chat interface with an AI Model to help you
build workflows.

You can use it to draft, proofread and debug job code, diagnose errors, and
understand the capabilities of the platform.

![AI Assistant](/img/ai-assistant.png)

:::caution Assistant Unavailable? Can't find it?

For local deployments of OpenFn, the instance administrator needs to configure the AI
Assistant before it is available. See
[deployment docs](https://github.com/OpenFn/lightning/blob/main/DEPLOYMENT.md#ai-chat)
here for help or contact the super user of your instance.

The Assistant is available on app.openfn.org, with usage credits subject your
project's plan. See [openfn.org/pricing](https://www.openfn.org/pricing) or contact [[email protected]](mailto:[email protected])
for more information on paid plans for usage of OpenFn's cloud-hosted platform.

:::

## About the Assistant

The AI Assistant is built on the Claude 3.5 Sonnet model from
[Anthropic](https://www.anthropic.com/) and is trained with OpenFn documentation
and example job code.

At the moment, the Assistant is only configured to help with job writing. Later
versions of the assistant may be rolled out to other pages.

All chat sessions are shared between all users of the project. You can start a
new chat session at any time, or open an old one.

Input data and run-time job logs not sent to the model. But we do include
your step code so that the Assistant can provide a contextually relevant answer.

## A Note on Responsible AI Usage

The AI assistant is built on emerging Large Language Model (terminology). Like
other LLMS and chatbots, its capabilities are impressive, but imperfect.

Remember that ultimately, all responses are generated by an algorithm and YOU,
the human in charge, are responsible for how its output is used. You should
consider all responses critically and verify the output where possible.

You can read more about our approach to AI in our
[Responsible AI Policy](https://www.openfn.org/ai).

## How to access the AI Assistant

The AI Assistant is located in the Inspector, in the Input panel to the left of
the step code. You may need to open the inspector first - to do this, click on a
step in the workflow and hit the `</>` button.

If there has been a prior chat session on this step, you'll be presented with a
list of them. Click on one to open up that chat history.

To stat a new session, type a question in the text area at the bottom of the
Assistant. Click on the `Send` button to send your question. The Assistant will
return a respond in a few seconds in the chat interface.

You can close a chat session by clicking the `(X)` button on the top right of
the chat interface, which will take you back to the list of sessions for this
step.

:::caution Feedback or Questions about the Assistant?

We welcome your questions or feedback on [community.openfn.org](https://community.openfn.org/),
or contact [[email protected]](mailto:[email protected]) with private queries.

:::
6 changes: 6 additions & 0 deletions docs/build/steps/step-editor.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ sidebar_label: Edit & Test Steps
This page outlines how to edit and test Steps in your Workflow using the
Inspector interface.

:::tip

If you're writing jobs on the platform app (Lightning), you can use the [AI Assistant](/documentation/build/ai-assistant) to help you. You'll find it in the Inspector.

:::

## Edit & Test Steps via the Inspector

Use the `Inspector` interface on the platform to create, edit, and test Steps.
Expand Down
6 changes: 6 additions & 0 deletions docs/jobs/job-writing-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ writing. It is suitable for new coders and experienced JavaScript programmers.
In fact, even if you're an experienced JavaScript developer, there are a number
of key patterns in the OpenFn ecosystem which it is important to learn.

:::tip

If you're writing jobs on the platform app (Lightning), you can use the [AI Assistant](/documentation/build/ai-assistant) to help you. You'll find it in the Inspector.

:::

A Job is a bunch of JavaScript code which performs a particular task, like
fetching data from Salesforce or converting some JSON data to FHIR standard.

Expand Down
1 change: 1 addition & 0 deletions sidebars-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ module.exports = {
'build/steps/steps',
'build/steps/step-editor',
'build/steps/step-design-intro',
'build/ai-assistant',
'build/paths',
'build/credentials',
'build/limits',
Expand Down
Binary file added static/img/ai-assistant.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.