Skip to content

feat: change IRequest answer type#35

Open
kilativ-dotcom wants to merge 4 commits into
ostis-ai:feat/ask-ai2025from
kilativ-dotcom:feat/ask-ai2025
Open

feat: change IRequest answer type#35
kilativ-dotcom wants to merge 4 commits into
ostis-ai:feat/ask-ai2025from
kilativ-dotcom:feat/ask-ai2025

Conversation

@kilativ-dotcom

@kilativ-dotcom kilativ-dotcom commented May 27, 2025

Copy link
Copy Markdown
Member

Important

Change IRequest answer type to TextItem[] and update components to handle this type.

  • Behavior:
    • Change answer type in IRequest from any to TextItem[] in requestDialogHistorySlice.ts.
    • Update AskAnswer.tsx to store answers as TextItem[] and dispatch them correctly.
    • Modify fetchAnswerByQuery to create TextItem[] for both found and not found answers.
  • Components:
    • Enable AnswerText component in AskElement.tsx to render TextItem[].
    • Uncomment AnswerText usage in AskElement.tsx.
  • Misc:
    • Remove commented-out code for translation in AskAnswer.tsx.

This description was created by Ellipsis for 37abd9a. You can customize this summary. It will automatically update as commits are pushed.

@kilativ-dotcom kilativ-dotcom self-assigned this May 27, 2025

@ellipsis-dev ellipsis-dev Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Caution

Changes requested ❌

Reviewed everything up to 37abd9a in 1 minute and 43 seconds. Click for details.
  • Reviewed 110 lines of code in 4 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. src/components/AskAnswer/AskElement/AskElement.tsx:9
  • Draft comment:
    Avoid using 'any' for the answer prop; update the IProps interface to use the TextItem[] type for better type safety.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.

Workflow ID: wflow_1TYSLLu8qD2yc97e

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

Comment thread src/components/AskAnswer/AskAnswer.tsx Outdated

if (answer) {
dispatch(addInHistory({ query, answer }));
const items: TextItem[] = [];

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Use an inline array literal for readability. Instead of creating an empty array and pushing, consider: const items = [{ type: 'normal', content: answer }].

content: 'Unfortunately, there is currently no information corresponding to your question in the knowledge base. We apologize for the inconvenience.',
});
dispatch(addInHistory({ query, answer: items }));
// dispatch(

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remove the commented-out translation code if it is no longer needed to keep the code clean.

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.

1 participant