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

Fix public assistants endpoint #318

Merged
merged 4 commits into from
Apr 26, 2024

Conversation

bakar-io
Copy link
Contributor

Frontend no longer uses this endpoint so there is no use for shared_id. Without that, the endpoint was always returning an empty list.

@andrewnguonly
Copy link
Contributor

The frontend still references the shared_id query param here: https://github.com/langchain-ai/opengpts/blob/main/frontend/src/components/Config.tsx#L419

I don't know if this code is functional or useful. Maybe consider removing this reference as well.

@bakar-io
Copy link
Contributor Author

Good point.

const link = currentLink.includes(props.assistantId)
    ? currentLink
    : currentLink + "?shared_id=" + props.assistantId;

includes always returns true. Will remove.

@bakar-io
Copy link
Contributor Author

@andrewnguonly Removed. Can you have another look please?

Copy link
Contributor

@andrewnguonly andrewnguonly left a comment

Choose a reason for hiding this comment

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

Approved and left one comment.

),
assistant_ids,
)
return await conn.fetch(("SELECT * FROM assistant WHERE public = true;"))
Copy link
Contributor

Choose a reason for hiding this comment

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

Double checking: I think the best practice (or technically correct) is to use the IS operator to evaluate boolean expressions.

WHERE public IS TRUE;

This might not matter.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good. Changed.

@mkorpela mkorpela merged commit 9f5a41f into langchain-ai:main Apr 26, 2024
6 checks passed
@bakar-io bakar-io deleted the fix-public-assistants-endpoint branch April 26, 2024 13:34
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.

3 participants