-
Notifications
You must be signed in to change notification settings - Fork 125
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
Simplify actions typing #11390
Simplify actions typing #11390
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Left 2 questions.
|
||
export class ConversationIncludeFileAction extends BaseAction { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm this is a bit of a divergence from what we have done so far with -Type object bien pure types vs classes.
Can we keep the original name out of consistency?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I overlooked this. Fixing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@spolu actually, it was not the case, we were already passing classes as "Type":

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(the previous types were also extending "BaseAction" class)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here actions comes from AgentMessageType
's actions
property which is filled in batchRenderAgentMessages that in turn call xxxActionTypesFromAgentMessageIds() that construct an instance of xxAction "the class" but says it returns xxActionType. Type checking do not complains but XXXActionType was indeed a class there (hence our ability to class renderXXX on them later).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For now:
- Option 1: remove "Type" suffix (but then we'll have
AgentMessageType
containing a non Type thing - Option 2: keep the "Type" suffix out of constency with the previous state of affair.
None of theses are great but the real solution is more involved and out of scope.
My take is option 2.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep let's do 2 👍👍
The -Type objects are simple JSON that can be serialised and deserialised at will in all of our codebase so this is introducing quite a big inconsistency here imho. Should we keep them? It's not much added complexity is it? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM post consistency fix
* Simplify TableQuery action * Simplify Browse action * Simplify DustAppRun action * Simplify Process action * Simplify Reasoning action * Simplify Retrieval action * Simplify Search Labels action * Simplify Websearch action * Simplify IncludeFile action * Simplify ListFiles action * Final simplification * Put back skip ts-error from philippe * Fix: import of server side stuff * Remove unused code
Description
Finally, simplify all actions types and code by:
Tests
Type-check + local
Risk
Low
Deploy Plan
Deploy
front
, monitor errors.