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

Allow setting conversation name in conversation.create #1717

Merged
merged 4 commits into from
Dec 21, 2024

Conversation

NolanTrem
Copy link
Collaborator

@NolanTrem NolanTrem commented Dec 21, 2024

Important

Add support for setting and updating conversation names in creation and update operations across backend and frontend.

  • Behavior:
    • Allow setting a conversation name in conversations.create() and conversations.update() in conversations.ts and conversations.py.
    • Update create_conversation and update_conversation endpoints in conversations_router.py to accept a name parameter.
  • Database:
    • Modify create_conversation and update_conversation in conversations.py to handle name and raise HTTPException on failure.
  • Tests:
    • Add tests for creating and updating a conversation with a name in ConversationsIntegrationSuperUser.test.ts.
  • Misc:
    • Remove unused code and comments in bcrypt.py and async_client.py.

This description was created by Ellipsis for b66a0eb. It will automatically update as commits are pushed.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Reviewed everything up to 58ee771 in 24 seconds

More details
  • Looked at 332 lines of code in 9 files
  • Skipped 0 files when reviewing.
  • Skipped posting 4 drafted comments based on config settings.
1. js/sdk/__tests__/ConversationsIntegrationSuperUser.test.ts:42
  • Draft comment:
    Consider checking for an empty string instead of null when verifying the conversation name, as the API might return an empty string for an unset name.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The test for creating a conversation without a name should check for an empty string instead of null, as the API might return an empty string for an unset name.
2. js/sdk/src/v3/clients/conversations.ts:24
  • Draft comment:
    Good use of conditional spread operator to include the name in the data object only if it is defined.
  • Reason this comment was not posted:
    Confidence changes required: 0%
    The create_conversation method in the ConversationsClient class uses a conditional spread operator to include the name in the data object. This is a good practice to ensure that only defined values are included in the request payload.
3. py/core/database/conversations.py:68
  • Draft comment:
    Good use of try-except block to handle exceptions and raise an HTTPException with a detailed error message.
  • Reason this comment was not posted:
    Confidence changes required: 0%
    The create_conversation method in the PostgresConversationsHandler class now includes a try-except block to handle exceptions and raise an HTTPException with a detailed error message. This is a good practice for error handling.
4. py/core/main/api/v3/conversations_router.py:90
  • Draft comment:
    The create_conversation endpoint now accepts a name parameter, aligning with the new feature of setting a conversation name during creation.
  • Reason this comment was not posted:
    Confidence changes required: 0%
    The create_conversation endpoint in the ConversationsRouter class now accepts a name parameter in the request body. This change aligns with the new feature of setting a conversation name during creation.

Workflow ID: wflow_WGnYUhZVNwjSOjAO


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

❌ Changes requested. Incremental review on 0127711 in 44 seconds

More details
  • Looked at 414 lines of code in 6 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 drafted comments based on config settings.
1. js/sdk/src/v3/clients/conversations.ts:86
  • Draft comment:
    Consider using PUT or PATCH for updating resources instead of POST for better RESTful API practices.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The update method in conversations.ts uses a POST request to update a conversation, which is unconventional. Typically, PUT or PATCH is used for updates. This might be intentional, but it's worth noting for consistency and clarity.
2. py/core/main/api/v3/conversations_router.py:280
  • Draft comment:
    Consider using PUT or PATCH for updating resources instead of POST for better RESTful API practices.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The update_conversation function in conversations_router.py uses a POST request to update a conversation, which is unconventional. Typically, PUT or PATCH is used for updates. This might be intentional, but it's worth noting for consistency and clarity.

Workflow ID: wflow_uopwY5Hah3eHw0cO


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

)
return conversation

@self.router.post(
"/conversations/{id}",
summary="Delete conversation",
Copy link
Contributor

Choose a reason for hiding this comment

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

The summary for the update_conversation endpoint is incorrect. It should be 'Update conversation' instead of 'Delete conversation'.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

❌ Changes requested. Incremental review on ce435a8 in 42 seconds

More details
  • Looked at 17 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 0 drafted comments based on config settings.

Workflow ID: wflow_FCmgCOoHhZ2ZCNSI


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

"lang": "cURL",
"source": textwrap.dedent(
"""
curl -X POST "https://api.example.com/v3/conversations/123e4567-e89b-12d3-a456-426614174000" \
Copy link
Contributor

Choose a reason for hiding this comment

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

The cURL example for updating a conversation should use the PUT method instead of POST for clarity and consistency with typical RESTful practices.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Incremental review on b66a0eb in 21 seconds

More details
  • Looked at 13 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. py/core/main/api/v3/conversations_router.py:282
  • Draft comment:
    Ensure that the CLI code sample reflects the update operation instead of delete.
  • Reason this comment was not posted:
    Comment did not seem useful.

Workflow ID: wflow_bGcELPIUJRnxnLzw


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@NolanTrem NolanTrem merged commit 42cbe7b into main Dec 21, 2024
14 of 15 checks passed
@NolanTrem NolanTrem deleted the Nolan/SetConversationName branch December 21, 2024 18:55
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