Skip to content

RSPEED-2867: Add ResponsesEventData format and builder#1550

Merged
tisnik merged 2 commits into
lightspeed-core:mainfrom
major:feat/responses-event-format
Apr 20, 2026
Merged

RSPEED-2867: Add ResponsesEventData format and builder#1550
tisnik merged 2 commits into
lightspeed-core:mainfrom
major:feat/responses-event-format

Conversation

@major
Copy link
Copy Markdown
Contributor

@major major commented Apr 20, 2026

Description

Add ResponsesEventData dataclass and build_responses_event() builder for Responses API Splunk telemetry, following the same pattern as InferenceEventData/build_inference_event() in rlsapi.py.

Part 2 of the RSPEED-2867 Splunk HEC telemetry work. This PR adds the event data format that PR 3 will use to build telemetry events in the /responses endpoint.

New file: src/observability/formats/responses.py

  • ResponsesEventData with fields: input_text, response_text, conversation_id, model, org_id, system_id, inference_time, input_tokens, output_tokens
  • build_responses_event() adds deployment from config and computes total_llm_tokens

Export chains updated in observability.formats and observability packages.

Dependencies: None (independent of PR #1548)

Type of change

  • New feature

Tools used to create PR

  • Assisted-by: Claude (Sisyphus agent via OpenCode)
  • Generated by: N/A

Related Tickets & Documents

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

  • uv run pytest tests/unit/observability/formats/test_responses.py -v - 4 tests covering field construction, token defaults, auth_disabled values, and total_llm_tokens computation
  • All existing tests pass (uv run make test-unit - 2033 passed)
  • uv run make verify passes all linters

major added 2 commits April 20, 2026 10:06
Add ResponsesEventData dataclass and build_responses_event() builder for
Responses API Splunk telemetry. Follows the same pattern as InferenceEventData
in rlsapi.py. Update export chains in observability package.

Signed-off-by: Major Hayden <mhayden@redhat.com>
Signed-off-by: Major Hayden <major@redhat.com>
Cover ResponsesEventData construction, token defaults, auth_disabled
values, and build_responses_event() output including deployment and
total_llm_tokens computation.

Signed-off-by: Major Hayden <mhayden@redhat.com>
Signed-off-by: Major Hayden <major@redhat.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 20, 2026

Warning

Rate limit exceeded

@major has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 49 minutes and 30 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 49 minutes and 30 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 9903d324-783d-4944-97bf-02cbbbf35296

📥 Commits

Reviewing files that changed from the base of the PR and between 14912a1 and d2a1a19.

📒 Files selected for processing (5)
  • src/observability/__init__.py
  • src/observability/formats/__init__.py
  • src/observability/formats/responses.py
  • tests/unit/observability/formats/README.md
  • tests/unit/observability/formats/test_responses.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
✨ Simplify code
  • Create PR with simplified code

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@tisnik
Copy link
Copy Markdown
Contributor

tisnik commented Apr 20, 2026

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis ✅

1548 - Fully compliant

Compliant requirements:

  • Add ResponsesEventData dataclass with required fields
  • Implement build_responses_event() builder
  • Update exports in the two __init__.py files
  • Add comprehensive unit tests for the new format
  • Lint checks and tests pass without regressions
⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 PR contains tests
🔒 Security concerns

No
followed all instructions

⚡ No major issues detected

Copy link
Copy Markdown
Contributor

@tisnik tisnik left a comment

Choose a reason for hiding this comment

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

LGTM



@dataclass
class ResponsesEventData: # pylint: disable=too-many-instance-attributes
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

yeah, pylint is super strict ;)

@tisnik tisnik merged commit a4cb698 into lightspeed-core:main Apr 20, 2026
28 of 29 checks passed
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.

2 participants