Skip to content

Conversation

@edward-ly
Copy link
Contributor

Resolves #217.

Continuing discussion from #227:

The only thing that is not working is the preservation of the "input" input because the default values are applied in 2 places:

  • AssistantTextProcessingForm::onTaskTypeUserChange (where the input is preserved)

  • AssistantFormInputs::watch::selectedTaskType

and if the second one happens after the first, the input field is cleared.

I'm not sure if AssistantFormInputs::watch::selectedTaskType has any purpose anymore, now that I think about it, especially now with the addition of the TranslateForm. Removing it fixed the issue for me.

@janepie
Copy link
Member

janepie commented May 8, 2025

As this watch sets the defaults, we still need it (or an alternative), for example for image generation

@janepie
Copy link
Member

janepie commented May 8, 2025

On further investigation, this should be done in AssistantTextProcessingForm::onTaskTypeUserChange as well, but for some reason the old task type is used there, not the recently chosen one

@edward-ly edward-ly force-pushed the feat/preserve-input branch from 9f6e6ef to bb08225 Compare May 8, 2025 15:01
@janepie
Copy link
Member

janepie commented May 9, 2025

Looks good to me so far. It doesn't work with the document generation task types as their input is labeled text, but maybe that should be changed in the task types, wdyt @julien-nc ?

@edward-ly
Copy link
Contributor Author

It doesn't work with the document generation task types as their input is labeled text, but maybe that should be changed in the task types, wdyt @julien-nc ?

Similarly, maybe source_input in context write could be renamed to just input as well? I can add a case for the text parameter in the meantime just like with source_input.

@edward-ly edward-ly requested a review from julien-nc May 12, 2025 15:16
@edward-ly edward-ly force-pushed the feat/preserve-input branch from bb08225 to b1a500b Compare May 12, 2025 16:12
Copy link
Member

@julien-nc julien-nc left a comment

Choose a reason for hiding this comment

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

I think it's fine like it is now. We can't change input shape keys of task types that were already in some releases, it would break loading the existing tasks that were created with the old keys.

@janepie janepie merged commit 87cc80a into main May 15, 2025
9 checks passed
@janepie janepie deleted the feat/preserve-input branch May 15, 2025 12:59
@julien-nc julien-nc mentioned this pull request Jun 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Preserve values when switching task types

4 participants