Skip to content

Conversation

@shaohuzhang1
Copy link
Contributor

fix: Chat log add to knowledge error

@f2c-ci-robot
Copy link

f2c-ci-robot bot commented Sep 29, 2025

Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@f2c-ci-robot
Copy link

f2c-ci-robot bot commented Sep 29, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

return result.success(ApplicationChatRecordAddKnowledgeSerializer(data = {'workspace_id': workspace_id, 'application_id': application_id, **request.data}).post_improve(
{'workspace_id': workspace_id, 'application_id': application_id, **request.data}, request=request))


Copy link
Contributor Author

Choose a reason for hiding this comment

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

The code has a few improvements. The existing post method is called on an instance of ApplicationChatRecordAddKnowledgeSerializer, which does not appear to be defined in the provided context. Assuming you want to handle POST request data directly, consider updating the serializer instantiation and passing it the combined dictionary from **request.data and {'workspace_id': workspace_id, 'application_id': application_id}. Also, using f-strings instead of string concatenation can make the code cleaner:

def post(self, request: Request, workspace_id: str, application_id: str) -> Response:
    data = {'workspace_id': workspace_id, 'application_id': application_id, **request.data}
    return result.success(
        ApplicationChatRecordAddKnowledgeSerializer(data=data).post_improve(request=request)
    )

This version avoids calling a non-existent method and uses modern Python features such as f-strings for formatting. Make sure that result.success() and ApplicationChatRecordAddKnowledgeSerializer.post_improve are correctly implemented elsewhere in your codebase.

@zhanweizhang7 zhanweizhang7 merged commit c3c53c1 into v2 Sep 29, 2025
4 of 6 checks passed
@zhanweizhang7 zhanweizhang7 deleted the pr@v2@fix_chat_add_knowledge branch September 29, 2025 02:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants