Skip to content

Conversation

@shaejaz
Copy link
Contributor

@shaejaz shaejaz commented Nov 20, 2025

Summary

Result

@codesandbox-ci
Copy link

codesandbox-ci bot commented Nov 20, 2025

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 9bac061:

Sandbox Source
example-instantsearch-getting-started Configuration
example-react-instantsearch-getting-started Configuration
example-react-instantsearch-next-app-dir-example Configuration
example-react-instantsearch-next-routing-example Configuration
example-vue-instantsearch-getting-started Configuration
const { items } = useHits();
const [suggestions, setSuggestions] = useState<Array<{ title: string }>>([]);

const { messages, status, sendMessage } = useChat({ agentId });
Copy link
Contributor

Choose a reason for hiding this comment

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

is useChat the right primitive for this? is there a different /chat and /completion endpoint?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I haven't come across a /chat endpoint yet so I've gone for the completions one.
I guess with some checking and cleanup code I can make it work similar to a chat endpoint. Not ideal but as a temp solution for now.

Copy link
Contributor

Choose a reason for hiding this comment

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

ah right, I didn't realise we already use the completions endpoint for chat as well. Seems logical then like this! the question is then if long term we should use useChat, or something lower level that doesn't imply the other functionality of chat like inputs and sending messages, but a static message instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants