parse ISO URL from streaming tool_result; refactor to pass C901#2779
parse ISO URL from streaming tool_result; refactor to pass C901#2779eliajahshan wants to merge 1 commit into
Conversation
|
Hi @eliajahshan. Thanks for your PR. I'm waiting for a github.com member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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. |
b770890 to
4807c28
Compare
4807c28 to
f3aab36
Compare
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: eliajahshan The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/test lint |
|
@eliajahshan: Cannot trigger testing until a trusted user reviews the PR and leaves an DetailsIn response to this:
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. |
|
/retest |
|
@eliajahshan: Cannot trigger testing until a trusted user reviews the PR and leaves an DetailsIn response to this:
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. |
|
/ok-to-test |
|
/lgtm |
|
@eliajahshan: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions 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. I understand the commands that are listed here. |
Summary
send_queryinto small helpers to reduce McCabe complexity (fix flake8 C901) without changing behavior.What changed
assisted-test-infra/src/chatbot_client.pyevent == "tool_result"withtool_name == "cluster_iso_download_url":data.token.responseand appends theurlto the response.send_queryinto helpers (no behavior change):_maybe_refresh_access_token,_build_payload_send_streaming_query,_send_non_streaming_query_parse_sse_line,_accumulate_event_update_conversation_id,_append_token,_append_tool_result.../v1) via_resolve_endpoint.streaming_enabled(default True).Why
Behavior and compatibility
ChatbotClient.send_query(question: str) -> str./v1URLs are resolved automatically.Environment variables
OFFLINE_TOKEN(required)ASSISTED_CHAT_API_URL(base e.g.,https://assisted-chat.api.openshift.com/v1or full endpoint)CHATBOT_STREAMING_ENABLED(optional; default True)Validation
.isoURL.flake8 src/chatbot_client.py(C901 resolved).response.Notes