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

Allow to pass file ID/path as initial input text field value #161

Merged
merged 4 commits into from
Dec 4, 2024

Conversation

julien-nc
Copy link
Member

This will be helpful to make file actions (in the Files app).

The OCA.Assistant.openAssistantForm function now accepts inputs like

{ input: { fileId: 123 } }

or

{ input: { filePath: '/path/to/file.txt' } }

and the parsed file content will be inserted in the input field on the fly.

@julien-nc julien-nc added enhancement New feature or request 3. to review labels Dec 3, 2024
@kyteinsky
Copy link
Contributor

let's update the docs with an example too (https://github.com/nextcloud/assistant/blob/main/docs/developer/web-integration.md)

Signed-off-by: Julien Veyssier <[email protected]>
@julien-nc julien-nc requested a review from kyteinsky December 4, 2024 10:49
@julien-nc
Copy link
Member Author

Dev docs are adjusted. They were a bit out of date as well.

identifier: 'my custom identifier',
inputs: { prompt: 'give me a short summary of a simple settings section about GitHub' },
customId: 'my custom identifier',
input: { input: 'give me a short summary of a simple settings section about GitHub' },
Copy link
Contributor

Choose a reason for hiding this comment

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

inputs first key here, typo

Copy link
Member Author

Choose a reason for hiding this comment

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

Done, thanks

Signed-off-by: Julien Veyssier <[email protected]>
Signed-off-by: Julien Veyssier <[email protected]>
@julien-nc julien-nc force-pushed the enh/noid/initial-text-input-file-id branch from c388010 to abb8fb0 Compare December 4, 2024 10:56
@julien-nc julien-nc requested a review from kyteinsky December 4, 2024 10:57
status: 3, // 0: unknown, 1: scheduled, 2: running, 3: sucessful, 4: failed
taskType: 'OCP\\TextProcessing\\FreePromptTaskType',
timestamp: 1711545305,
output: { output: 'blabla' },
Copy link
Contributor

Choose a reason for hiding this comment

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

and outputs perhaps? I didn't see the code.

Copy link
Contributor

@kyteinsky kyteinsky left a comment

Choose a reason for hiding this comment

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

nice 🎉
and neat feature!

@julien-nc julien-nc merged commit bd20b56 into main Dec 4, 2024
11 checks passed
@julien-nc julien-nc mentioned this pull request Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants