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

feat: chatty ui #86

Merged
merged 26 commits into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
52f84af
feat: chatty ui
kyteinsky May 8, 2024
c277ef2
always dispatch RenderReferenceEvent, fix NcRichtext missing prop
julien-nc May 28, 2024
35da734
fix scroll for the chattyUI, navigation still does not take full heig…
julien-nc May 28, 2024
91e3c6c
fix: link reference style fix
kyteinsky May 28, 2024
2ec8ed3
fix: make height of chattyUI constant (max), center emptyContent, fix…
julien-nc May 29, 2024
510e00d
fix: centered loading spinner for initial messages loading
kyteinsky May 29, 2024
b47e337
use Conversation instead of Session
kyteinsky May 29, 2024
aa3edcb
create an empty new session on button click
kyteinsky May 29, 2024
f240d27
create an empty new session on button click
kyteinsky May 29, 2024
f7da94b
emoji and smart picker style fixes
kyteinsky May 30, 2024
4bbfb73
multilingual prompt
kyteinsky Jun 12, 2024
f35698e
multilingual titile gen prompt
kyteinsky Jun 12, 2024
c98f9ea
fix: do not delete if generation fails in regenerate
kyteinsky Jun 12, 2024
d3dac85
style fixes
kyteinsky Jun 12, 2024
70cb624
no translation of the user prompts
kyteinsky Jun 12, 2024
47d49a0
move admin docs to nextcloud documentation
kyteinsky Jun 12, 2024
8c26c13
more style fixes
kyteinsky Jun 12, 2024
abce69c
regenerate only on last assistant msg + fault tolerance
kyteinsky Jun 13, 2024
2e5b612
get the title from first message + first message not visible fix
kyteinsky Jun 13, 2024
418a601
deleteMessageById
kyteinsky Jun 13, 2024
ca9d198
one more style fix
kyteinsky Jun 13, 2024
459a0a0
update user intructions, does not work well with some models
kyteinsky Jun 13, 2024
82cd1e9
review fixes
kyteinsky Jun 13, 2024
f7fe8e8
NcAppNavigation popover fix
kyteinsky Jun 18, 2024
8a15a5b
remove countdown and limit title to 100 chars
kyteinsky Jun 18, 2024
89c93c1
fix: force --default-clickable-area value for message action (server …
julien-nc Jun 18, 2024
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ include text processing providers to:
* Get an answer from a free prompt
* Reformulate (OpenAi/LocalAi only)
* Context writer: Generate text with a specified style. The style can be described or provided via an example text.
* Chat with AI

### Text to image (Image generation)

Expand Down
2 changes: 1 addition & 1 deletion appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Known providers:
* [OpenAi/LocalAI integration](https://apps.nextcloud.com/apps/integration_openai)
* [Local Whisper Speech-To-Text](https://apps.nextcloud.com/apps/stt_whisper)
]]> </description>
<version>1.0.9</version>
<version>1.1.0</version>
kyteinsky marked this conversation as resolved.
Show resolved Hide resolved
<licence>agpl</licence>
<author>Julien Veyssier</author>
<namespace>Assistant</namespace>
Expand Down
11 changes: 11 additions & 0 deletions appinfo/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,17 @@
['name' => 'SpeechToText#getResultPage', 'url' => '/stt/result-page/{metaTaskId}', 'verb' => 'GET'],

['name' => 'preview#getFileImage', 'url' => '/preview', 'verb' => 'GET'],

['name' => 'chattyLLM#newSession', 'url' => '/chat/new_session', 'verb' => 'PUT'],
['name' => 'chattyLLM#updateSessionTitle', 'url' => '/chat/update_session', 'verb' => 'PATCH'],
['name' => 'chattyLLM#deleteSession', 'url' => '/chat/delete_session', 'verb' => 'DELETE'],
['name' => 'chattyLLM#getSessions', 'url' => '/chat/sessions', 'verb' => 'GET'],
['name' => 'chattyLLM#newMessage', 'url' => '/chat/new_message', 'verb' => 'PUT'],
['name' => 'chattyLLM#deleteMessage', 'url' => '/chat/delete_message', 'verb' => 'DELETE'],
['name' => 'chattyLLM#getMessages', 'url' => '/chat/messages', 'verb' => 'GET'],
['name' => 'chattyLLM#generateForSession', 'url' => '/chat/generate', 'verb' => 'GET'],
['name' => 'chattyLLM#regenerateForSession', 'url' => '/chat/regenerate', 'verb' => 'GET'],
['name' => 'chattyLLM#generateTitle', 'url' => '/chat/generate_title', 'verb' => 'GET'],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At some point it would be nice to migrate to the new Route annotation by kate

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We would be losing support for the previous server versions if we do that now. Also, personally I would like to keep this alongside that, if possible, to have a quick look at all the endpoints declared in the app.

],
'ocs' => [
['name' => 'assistantApi#getAvailableTaskTypes', 'url' => '/api/{apiVersion}/task-types', 'verb' => 'GET', 'requirements' => $requirements],
Expand Down
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

* [User documentation](./user)
* [Developer documentation](./developer)
* [AI admin doc](https://docs.nextcloud.com/server/latest/admin_manual/ai/index.html)
* [AI admin Nextcloud documentation](https://docs.nextcloud.com/server/latest/admin_manual/ai/index.html)
3 changes: 3 additions & 0 deletions lib/AppInfo/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ class Application extends App implements IBootstrap {
public const TASK_CATEGORY_TEXT_TO_IMAGE = 1;
public const TASK_CATEGORY_SPEECH_TO_TEXT = 2;

public const CHAT_USER_INSTRUCTIONS = 'This is a conversation in a specific language between {user} and you, Nextcloud Assistant. You are a kind, polite and helpful AI that helps {user} to the best of its abilities. If you do not understand something, you will ask for clarification. Detect the language that {user} is using. Make sure to use the same language in your response. Do not mention the language explicitly.';
public const CHAT_USER_INSTRUCTIONS_TITLE = 'Above is a chat session in a specific language between {user} and you, Nextcloud Assistant. Generate a suitable title summarizing the conversation in the same language. Output only the title in plain text, nothing else.';

public function __construct(array $urlParams = []) {
parent::__construct(self::APP_ID, $urlParams);
}
Expand Down
Loading
Loading