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

[Odysseus] Overhauling framework in line with backend services #78989

Conversation

AllTerrainDeveloper
Copy link
Contributor

@AllTerrainDeveloper AllTerrainDeveloper commented Jul 5, 2023

Related to https://github.com/Automattic/ai-services/issues/59

Proposed Changes

Overhauling the Odysseus Framework as per design specifications

Testing Instructions

Those are specified in D115311 :)

@AllTerrainDeveloper AllTerrainDeveloper requested a review from a team July 5, 2023 12:50
@AllTerrainDeveloper AllTerrainDeveloper self-assigned this Jul 5, 2023
@matticbot matticbot added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Jul 5, 2023
@matticbot
Copy link
Contributor

matticbot commented Jul 5, 2023

@matticbot
Copy link
Contributor

matticbot commented Jul 5, 2023

Here is how your PR affects size of JS and CSS bundles shipped to the user's browser:

App Entrypoints (~337 bytes added 📈 [gzipped])

name           parsed_size           gzip_size
entry-stepper       +626 B  (+0.0%)     +144 B  (+0.0%)
entry-main          +626 B  (+0.0%)     +192 B  (+0.0%)

Common code that is always downloaded and parsed every time the app is loaded, no matter which route is used.

Legend

What is parsed and gzip size?

Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory.
Gzip Size: Compressed size of the JS and CSS files. This much data needs to be downloaded over network.

Generated by performance advisor bot at iscalypsofastyet.com.

Copy link
Contributor

@kthai15 kthai15 left a comment

Choose a reason for hiding this comment

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

I pushed up a few commits to sync some types between client and server, hopefully they make sense 😃

@@ -9,25 +9,52 @@ export type Nudge = {
initialMessage: string;
context?: Record< string, unknown >;
};

export type MessageRole = 'user' | 'bot';
Copy link
Contributor

Choose a reason for hiding this comment

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

Updated this to match the enum declaration on the server
https://github.com/Automattic/ai-services/blob/trunk/odysseus/app/schemas.py#L15-L18

Comment on lines +17 to +22
export type Message = {
content: string;
role: MessageRole;
type: MessageType;
chatId?: string | null;
};
Copy link
Contributor

Choose a reason for hiding this comment

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

updated type definition


export type MessageRole = 'user' | 'bot';

export type MessageType = 'message' | 'action' | 'meta' | 'error';
Copy link
Contributor

Choose a reason for hiding this comment

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

interface OdysseusAssistantContextInterface {
currentView: string;
setCurrentView: ( currentView: string ) => void;
addMessage: ( message: Message ) => void;
Copy link
Contributor

Choose a reason for hiding this comment

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

Simplified params to use Message type

@AllTerrainDeveloper
Copy link
Contributor Author

More than welcome those changes!

Copy link
Contributor

@gravityrail gravityrail left a comment

Choose a reason for hiding this comment

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

This LGTM

@gravityrail gravityrail merged commit b6402d8 into trunk Jul 6, 2023
@gravityrail gravityrail deleted the prismiwi2015/overhauling-framework-in-line-with-backend-services branch July 6, 2023 00:17
@github-actions github-actions bot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Jul 6, 2023
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.

4 participants