diff --git a/module/move/assistant/design/Commands.md b/module/move/assistant/design/Commands.md new file mode 100644 index 0000000000..7030f166a2 --- /dev/null +++ b/module/move/assistant/design/Commands.md @@ -0,0 +1,99 @@ +# Commands + +## Legend + +- `<...>` - argument. +- `<..?>` - optional argument. +- `<...=...>` - argument with default value. +- `!` - command requires a set of messages, however that set is hard to encode in CLI. + +## OpenAI + +### Users + +```shell +assistant openai users list +assistant openai users modify +assistant openai users retrieve +assistant openai users delete +``` + +### Projects + +```shell +assistant openai projects list +assistant openai projects create +assistant openai projects retrieve +assistant openai projects modify +assistant openai projects archive +``` + +### Project users + +```shell +assistant openai project-users list +assistant openai project-users create +assistant openai project-users retrieve +assistant openai project-users modify +assistant openai project-users delete +``` + +### Project API keys + +```shell +assistant openai project-api-keys list +assistant openai project-api-keys retrieve +assistant openai project-api-keys delete +``` + +### Assistants + +```shell +assistant openai assistants create +assistant openai assistants list +assistant openai assistants retrieve +assistant openai assistants modify +assistant openai assistants delete +``` + +### Threads + +```shell +assistant openai threads create +assistant openai threads retrieve +assistant openai threads delete +``` + +### Messages + +```shell +assistant openai messages create +assistant openai messages list +assistant openai messages retrieve +assistant openai messages modify +assistant openai messages delete +``` + +### Chat + +```shell +!assistant openai chat create-completion +``` + +### Runs + +```shell +assistant openai runs create +assistant openai runs list +assistant openai runs retrieve +assistant openai runs cancel +``` + +## Anthropic + +### Messages + +```shell +!assistant anthropic messages create +``` + diff --git a/module/move/assistant/design/Entities.mmd b/module/move/assistant/design/Entities.mmd new file mode 100644 index 0000000000..5b23454265 --- /dev/null +++ b/module/move/assistant/design/Entities.mmd @@ -0,0 +1,21 @@ +graph TD + subgraph OpenAI + U[Users] + P[Projects] + PAK[Project API keys] + A[Assistants] + T[Threads] + M[Messages] + R[Runs] + + P -- has (through Project Users) --> U + P -- has --> PAK + + T -- has --> M + + T -- has --> R + + A -. are called in .-> R + + R -. generate .-> M + end diff --git a/module/move/assistant/design/Entities.png b/module/move/assistant/design/Entities.png new file mode 100644 index 0000000000..bd7ce17fab Binary files /dev/null and b/module/move/assistant/design/Entities.png differ diff --git a/module/move/assistant/design/Scenarios.md b/module/move/assistant/design/Scenarios.md new file mode 100644 index 0000000000..22d660a126 --- /dev/null +++ b/module/move/assistant/design/Scenarios.md @@ -0,0 +1,85 @@ +# Scenarios + +## OpenAI + +### Projects + +#### Create and add users to a new project + +```shell +assistant openai projects create 'AnotherAI' +``` + +Administrator will receive the project ID (referred as ``). + +Then, to add users to the projects, administrator should know their IDs (referred as `` and ``). + +```shell +assistant openai project-users create owner +assistant openai project-users create member +``` + +Now, to check that the list of users is filled correctly, one can use: + +```shell +assistant openai project-users list +``` + +To list project API keys, one can use: + +```shell +assistant openai project-api-keys list +``` + +#### Project "rebranding" + +Consider situation: + +1. Owner of the organization is changed. +2. New owner decided to rename the project. +3. Also new owner decided to delete and add new employees to the project. + +Changing the organization owner is done like this: + +```shell +assistant openai users modify owner +assistant openai users modify reader +``` + +To rename the project and reassign employees, these commands are used: + +```shell +assistant openai projects modify 'AnotherAwesomeAI' +assistant openai project-users delete +assistant openai project-users create member +``` + + +### Assistants + +#### Make new assistant + +```shell +assistant openai assistants create gpt-4o-mini CoolBot 'CoolBot is a helpful assistant.' 'You are a helpful assistant.' +``` + +This command will return assistant ID. + +#### Chat with the assistant + +To chat with OpenAI assistant, one should do this: + +1. Create a thread. Thread is like a chat. +2. Write a message in thread (e.g. a question). +3. Run the assistant in the thread. + +```shell +assistant openai threads create +``` + +This command will return the new thread ID (referred as `thread_id`). To call an assistant, you need to know its ID. + +```shell +assistant openai messages create user '2 + 2 = ?' +assistant openai runs create +```