Skip to content

fix: Allow specifying lang code in chat requests#80

Merged
Ruari-Phipps merged 1 commit intomainfrom
ruari/fix/allow_specifying_lang_code
Apr 15, 2026
Merged

fix: Allow specifying lang code in chat requests#80
Ruari-Phipps merged 1 commit intomainfrom
ruari/fix/allow_specifying_lang_code

Conversation

@Ruari-Phipps
Copy link
Copy Markdown
Collaborator

@Ruari-Phipps Ruari-Phipps commented Apr 15, 2026

Summary

Adds --lang, --input-lang, and --output-lang flags to poly chat, allowing users to specify language codes for ASR (input) and TTS (output) when starting or continuing a chat session.

Motivation

Users chatting against multilingual agents need a way to specify the expected input/output language without relying on the project default. This exposes the existing asr_lang_code / tts_lang_code API fields via the CLI.

Changes

  • Added --lang, --input-lang, --output-lang arguments to the chat subcommand in cli.py
  • --lang sets both input and output lang; --input-lang/--output-lang override individually
  • Threaded input_lang / output_lang through AgentStudioProject.create_chat_session, send_message, AgentStudioInterface, and PlatformAPIHandler for both standard and draft/branch chat flows
  • Maps input_langasr_lang_code and output_langtts_lang_code in API request payloads

Test strategy

  • Added/updated unit tests
  • Manual CLI testing (poly <command>)
  • Tested against a live Agent Studio project
  • N/A (docs, config, or trivial change)

Checklist

  • ruff check . and ruff format --check . pass
  • pytest passes
  • No breaking changes to the poly CLI interface (or migration path documented)
  • Commit messages follow conventional commits

Screenshots / Logs

Screenshot 2026-04-15 at 12 05 11

@Ruari-Phipps Ruari-Phipps requested a review from a team April 15, 2026 11:06
@github-actions
Copy link
Copy Markdown
Contributor

Coverage Report

Base (main) PR Change
71.6% 71.5% -0.2% ⚠️

Changed file coverage

File Coverage Change
poly/handlers/platform_api.py 32.1% -4.5% ⚠️
poly/cli.py 43.5% +0.1% ✅

@Ruari-Phipps Ruari-Phipps merged commit b9070b9 into main Apr 15, 2026
3 checks passed
@Ruari-Phipps Ruari-Phipps deleted the ruari/fix/allow_specifying_lang_code branch April 15, 2026 14:01
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