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: add form experiment badge #13

Conversation

wanglam
Copy link
Collaborator

@wanglam wanglam commented Nov 24, 2023

Description

  1. Separate ChatWindowHeaderTitle
  2. Add experimental badge

Issues Resolved

List any issues this PR will resolve, e.g. Closes [...].

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: SuZhou-Joe <[email protected]>
Signed-off-by: SuZhou-Joe <[email protected]>
Signed-off-by: SuZhou-Joe <[email protected]>
Signed-off-by: SuZhou-Joe <[email protected]>
Signed-off-by: SuZhou-Joe <[email protected]>
Signed-off-by: SuZhou-Joe <[email protected]>
Signed-off-by: SuZhou-Joe <[email protected]>
Signed-off-by: SuZhou-Joe <[email protected]>
Signed-off-by: SuZhou-Joe <[email protected]>
Signed-off-by: SuZhou-Joe <[email protected]>
Signed-off-by: SuZhou-Joe <[email protected]>
Signed-off-by: SuZhou-Joe <[email protected]>
Signed-off-by: SuZhou-Joe <[email protected]>
…(#10)

* feat: change implementation of basic_input_output to built-in parser

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: update CHANGELOG

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: enable build input-output message

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: sort interactions

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: remove useless code

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: use parent_interaction_id as traceId

Signed-off-by: SuZhou-Joe <[email protected]>

---------

Signed-off-by: SuZhou-Joe <[email protected]>
@wanglam wanglam marked this pull request as ready for review November 24, 2023 08:24
Comment on lines 23 to 29
const closePopover = useCallback(() => {
setVisible(false);
}, []);

const handleIconClick = useCallback((e) => {
setVisible((flag) => !flag);
}, []);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Lint seems to throw a warning or error. Prefer add setVisible to dependencies or not use useCallback to wrap.

Copy link
Member

Choose a reason for hiding this comment

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

i don't think setVisible is needed in dependencies, it's always the same. if needed you can add comment to ignore the linter warning, and in the future we can probably use something like useEffectEvent. But i agree the useCallback doesn't seem to do much here

if (status === 'updated') {
chatContext.setTitle(newTitle);
}
setRenameModelOpen(false);
Copy link
Collaborator

@raintygao raintygao Nov 24, 2023

Choose a reason for hiding this comment

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

Same as above.

* feat: add mechannism to register messageParser

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: update

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: add interaction into message_bubble.tsx

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: update CHANGELOG

Signed-off-by: SuZhou-Joe <[email protected]>

* fix: lint checker

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: remove useless code

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: update

Signed-off-by: SuZhou-Joe <[email protected]>

---------

Signed-off-by: SuZhou-Joe <[email protected]>
@SuZhou-Joe
Copy link
Member

Would you mind adding this PR into CHANGELOG.md? It is an official and complete feature.

export const ChatExperimentalBadge = ({ onClick }: ChatExperimentalBadgeProps) => {
const [visible, setVisible] = useState(false);

const closePopover = useCallback(() => {
Copy link
Member

Choose a reason for hiding this comment

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

why useCallback? i don't think EuiPopover is memorized

New conversation
</EuiContextMenuItem>,
<EuiContextMenuItem
key="save-as-notebook"
Copy link
Member

Choose a reason for hiding this comment

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

not this PR but maybe TODO for future: would be better if this functionality comes from observability so that olly doesn't show the button if notebooks is not installed, and olly doesn't need to track breaking changes from observability

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good point. Will add some annotations about it.

closePopover();
}}
// User only can save conversation when he send a message at least.
disabled={chatState.messages.filter((item) => item.type === 'input').length < 1}
Copy link
Member

Choose a reason for hiding this comment

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

nit

Suggested change
disabled={chatState.messages.filter((item) => item.type === 'input').length < 1}
disabled={chatState.messages.every((item) => item.type !== 'input')}

</EuiPopover>
{isRenameModelOpen && (
<EditConversationNameModal
sessionId={chatContext.sessionId!}
Copy link
Member

Choose a reason for hiding this comment

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

modal should be in the same react context, why does it need to be passed in?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The EditConversationNameModal is a shared component, it will be reused in public/tabs/history/chat_history_search_list.tsx. We need to pass different sessionId and defaultTitle here. So it doesn't use the sessionId from the chat context.

* Integrate Memeory APIs of agent framework

Signed-off-by: gaobinlong <[email protected]>

* Add TODO to getSessions()

Signed-off-by: gaobinlong <[email protected]>

---------

Signed-off-by: gaobinlong <[email protected]>
const { loadChat } = useChatActions();
const core = useCore();
const [isPopoverOpen, setPopoverOpen] = useState(false);
const [isRenameModelOpen, setRenameModelOpen] = useState(false);
Copy link
Member

Choose a reason for hiding this comment

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

Seems this was added earlier, but it's a typo: model -> modal

* feat: add implement visualization in customized parser

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: add csv-parser lib

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: add csv-parser lib

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: add test cases

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: optimize

Signed-off-by: SuZhou-Joe <[email protected]>

---------

Signed-off-by: SuZhou-Joe <[email protected]>
@wanglam wanglam force-pushed the feat-add-experiment-icon-and-tooltip branch from 9895949 to 3e1505f Compare November 30, 2023 03:10
@SuZhou-Joe SuZhou-Joe closed this Dec 1, 2023
@SuZhou-Joe SuZhou-Joe reopened this Dec 1, 2023
@SuZhou-Joe SuZhou-Joe closed this Dec 1, 2023
@SuZhou-Joe SuZhou-Joe reopened this Dec 1, 2023
@SuZhou-Joe SuZhou-Joe closed this Dec 1, 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.

6 participants