Skip to content

feat: add conversations submit command#62

Merged
lorenjphillips merged 1 commit into
mainfrom
feat/conversations-submit
May 5, 2026
Merged

feat: add conversations submit command#62
lorenjphillips merged 1 commit into
mainfrom
feat/conversations-submit

Conversation

@lorenjphillips

@lorenjphillips lorenjphillips commented May 5, 2026

Copy link
Copy Markdown
Contributor

Summary

  • New coval conversations submit subcommand wrapping POST /v1/conversations:submit.
  • Supports the full ingestion contract: transcript JSON file, local audio file (base64-encoded), presigned audio URL, or prior upload reference (mutually exclusive).
  • Repeatable --metric and --metadata key=value, plus --external-id, --agent-id, --occurred-at.
  • Closes the gap where customers wanting to push production conversations into Coval monitoring had to hit the raw API.

Validation

  • Build clean: cargo build
  • Lints clean: cargo clippy --all-targets -- -D warnings
  • Help text + client-side validation smoke-tested locally:
    • rejects empty input with friendly message
    • rejects multiple audio sources with friendly message
    • rejects malformed --metadata values
    • Production calls uploaded via cli and confirmed

Summary by CodeRabbit

  • New Features

    • Added conversation submission API endpoint that accepts transcripts, audio (file, URL, or upload ID), metadata, metrics, and timing information.
    • Added CLI command to submit conversations with support for local audio file encoding and JSON transcript parsing.
  • Breaking Changes

    • Removed in_progress_metrics field from conversation progress tracking.

Adds `coval conversations submit` for ingesting monitored conversations.
Wraps POST /v1/conversations:submit with mutually-exclusive audio sources
(--audio-file base64-encodes locally, --audio-url, --upload-id), optional
--transcript-file (JSON array), repeatable --metric and --metadata k=v,
plus --external-id, --agent-id, --occurred-at.
@coderabbitai

coderabbitai Bot commented May 5, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

The pull request adds a new submission workflow for conversations across the API client and CLI. It introduces the base64 dependency, defines request/response types for conversation submission, implements a client method to POST submissions, and provides a CLI command with argument parsing and request building logic.

Changes

Conversation Submission Workflow

Layer / File(s) Summary
Dependency
Cargo.toml
Added base64 = "0.22" dependency for audio encoding.
Data Types
src/client/models/conversation.rs
Removed in_progress_metrics field from ConversationProgress. Introduced SubmitConversationRequest (with transcript, audio sources, metrics, metadata, and timing fields) and SubmitConversationResponse (wraps returned Conversation).
Client API
src/client/mod.rs
Added pub async fn submit() method to ConversationsClient that POSTs SubmitConversationRequest to /v1/conversations:submit and returns the Conversation from the response.
CLI Command
src/commands/conversations.rs
Added SubmitArgs struct with fields for transcript file, audio sources (file, URL, or upload ID), metrics, metadata, external ID, agent ID, and occurrence timestamp. Added Submit variant to ConversationCommands. Implemented build_submit_request() helper that validates mutually exclusive audio sources, encodes audio to Base64, parses JSON transcripts, and constructs the request. Integrated submit execution path into command dispatcher.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 A new submit command hops in with grace,
Audio and transcripts find their place,
Base64 encoding, validation so tight,
From CLI to API, the conversation takes flight! 🚀

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The pull request title clearly and accurately summarizes the main change: adding a new conversations submit command to the CLI.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/conversations-submit

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

@callumreid callumreid left a comment

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.

💯

@lorenjphillips lorenjphillips merged commit e4e2aec into main May 5, 2026
7 checks passed
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