Skip to content

Log unparsable response

Tan Le requested to merge log-unparsable-response into main

What does this merge request do and why?

To enable better visibility of unparsable response, we need to capture them in debug log.

Related thread gitlab-org/gitlab#474689 (comment 2019715319)

How to set up and validate locally

  1. Ensure GCP environment variables are setup.
  2. Check out to this merge request's branch.
  3. Make the following change to simulate time-out requests.
    diff --git a/promptlib/completion/gitlab_models.py b/promptlib/completion/gitlab_models.py
    index ca4b284..c092a73 100644
    --- a/promptlib/completion/gitlab_models.py
    +++ b/promptlib/completion/gitlab_models.py
    @@ -236,7 +236,8 @@ class GitlabSlashCommandModelHandle(ModelHandle):
             variables = [{"requestIds": [request_id]} for request_id in batch_request_id]
    
             def _retry_condition(response: dict | None) -> bool:
    -            return self._extract_content(response).failure
    +            # return self._extract_content(response).failure
    +            return True
    
             responses = asyncio.run(
                 graphql_batch_request(
  4. Run the follow command to kick off the pipeline.
    poetry run promptlib duo-chat eval --config-file=data/config/root_cause_analysis/eval_slash_troubleshoot_experiment.example.json --test-run --sample-size 1
  5. Observe the result of last call attempt in the log output.

Merge request checklist

  • I've ran the affected pipeline(s) to validate that nothing is broken.
  • Tests added for new functionality. If not, please raise an issue to follow up.
  • Documentation added/updated, if needed.
Edited by Tan Le

Merge request reports