Skip to content

Conversation

@sriroopar
Copy link
Contributor

@sriroopar sriroopar commented Nov 12, 2025

Description

Added info logs to display information on document retrieved, indices, rank, score and the final document that's picked based on the metrics.

Type of change

  • Refactor
  • New feature
  • Bug fix
  • CVE fix
  • Optimization
  • Documentation Update
  • Configuration Update
  • Bump-up dependent library
  • Bump-up library or tool used for development (does not change the final image)
  • CI configuration change
  • Konflux configuration change

Related Tickets & Documents

  • Related Issue #
  • Closes #

Checklist before requesting a review

  • I have performed a self-review of my code.
  • PR has passed all pre-merge test jobs.
  • If it is a core feature, I have added thorough tests.

Testing

  • Please provide detailed steps to perform tests related to this code change.

  • How were the fix/results from this change verified? Please provide relevant screenshots or results.
    Verified by running RAG test suite and logs were checked.

image

@openshift-ci openshift-ci bot requested review from bparees and onmete November 12, 2025 21:44
@openshift-ci
Copy link

openshift-ci bot commented Nov 12, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign joshuawilson for approval. For more information see the Code Review Process.

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

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

@sriroopar sriroopar force-pushed the byok_log_enhancements branch from 3035f96 to 6775874 Compare November 12, 2025 22:15
@sriroopar
Copy link
Contributor Author

/retest

5 similar comments
@sriroopar
Copy link
Contributor Author

/retest

@sriroopar
Copy link
Contributor Author

/retest

@sriroopar
Copy link
Contributor Author

/retest

@sriroopar
Copy link
Contributor Author

/retest

@sriroopar
Copy link
Contributor Author

/retest

@sriroopar sriroopar force-pushed the byok_log_enhancements branch from e9c6284 to b559dd8 Compare November 18, 2025 16:58
@sriroopar
Copy link
Contributor Author

/retest


available_tokens = min(tokens_count, max_tokens)
logger.debug("Available tokens: %d.", tokens_count)
logger.debug("Available tokens: %d.", available_tokens)
Copy link
Contributor

Choose a reason for hiding this comment

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

I supose this should show the total number of available tokens in the context window, but it is not showing that:

2025-11-19 08:03:01,970 [ols.utils.token_handler:token_handler.py:152] DEBUG: RAG content tokens count: 345.
2025-11-19 08:03:01,970 [ols.utils.token_handler:token_handler.py:155] DEBUG: Available tokens: 345.
2025-11-19 08:03:01,970 [ols.utils.token_handler:token_handler.py:169] INFO: Document #2 selected: title='Preparing your cluster for OpenShift Virtualization', url='https://docs.openshift.com/container-platform/4.17/virt/install/preparing-cluster-for-virt.html', index='default', score=0.5925, tokens=345
2025-11-19 08:03:01,971 [ols.utils.token_handler:token_handler.py:152] DEBUG: RAG content tokens count: 358.
2025-11-19 08:03:01,971 [ols.utils.token_handler:token_handler.py:155] DEBUG: Available tokens: 358.
2025-11-19 08:03:01,971 [ols.utils.token_handler:token_handler.py:169] INFO: Document #3 selected: title='Installing a cluster on any platform', url='https://docs.openshift.com/container-platform/4.17/installing/installing_platform_agnostic/installing-platform-agnostic.html', index='default', score=0.5889, tokens=358

It is showing the same number twice.

Copy link
Contributor

Choose a reason for hiding this comment

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

@sriroopar
It still shows the wrong number as available tokens

2025-11-24 08:30:07,444 [ols.utils.token_handler:token_handler.py:124] INFO: Processing 5 retrieved nodes for RAG context
2025-11-24 08:30:07,444 [ols.utils.token_handler:token_handler.py:152] DEBUG: RAG content tokens count: 103.
2025-11-24 08:30:07,444 [ols.utils.token_handler:token_handler.py:155] DEBUG: Available tokens: 103.

Also, please remove the . after the digit.

"""Initialize custom query fusion class."""
# Extract custom parameters before passing to parent
retriever_weights = kwargs.pop("retriever_weights", None)
index_configs = kwargs.pop("index_configs", None)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why pop instead of get? Do you need to modify input kwargs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Assumed that there params will be considered into the parent class, but after checking that's not the case. Updating it to be .get()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think the pop is required here, so that these custom params are not plugged into the parent class. It's also causing e2e and eval to fail, fixing it now!

@sriroopar sriroopar force-pushed the byok_log_enhancements branch 4 times, most recently from 91f3def to 350685c Compare November 21, 2025 17:06
@sriroopar sriroopar requested a review from onmete November 23, 2025 01:12
@sriroopar sriroopar force-pushed the byok_log_enhancements branch from 350685c to 4480685 Compare November 25, 2025 01:34
 #Reverting the storing changes
@sriroopar sriroopar force-pushed the byok_log_enhancements branch from 4480685 to 36d0d5c Compare November 25, 2025 04:13
@sriroopar
Copy link
Contributor Author

/retest

4 similar comments
@sriroopar
Copy link
Contributor Author

/retest

@sriroopar
Copy link
Contributor Author

/retest

@sriroopar
Copy link
Contributor Author

/retest

@sriroopar
Copy link
Contributor Author

/retest

@openshift-ci
Copy link

openshift-ci bot commented Nov 26, 2025

@sriroopar: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-ols-cluster 36d0d5c link unknown /test e2e-ols-cluster

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

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.

2 participants