Skip to content

Re-introduced translation#75

Merged
djthorpe merged 1 commit intomainfrom
djt-0618-api
Jun 18, 2025
Merged

Re-introduced translation#75
djthorpe merged 1 commit intomainfrom
djt-0618-api

Conversation

@djthorpe
Copy link
Copy Markdown
Member

  • Added translation for gowhisper
  • Removed some debugging
  • Added a 404 handler for unmatched requests

@djthorpe djthorpe requested a review from Copilot June 18, 2025 06:13
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR reintroduces translation support for the gowhisper client, removes leftover debug logging, and adds a catch-all 404 handler at the root path.

  • Renames gowhisper field in opts to transcribe, adds a new translate field, and updates option setters.
  • Re-enables c.gowhisper.Translate in client.go and removes outdated commented blocks.
  • Removes debug fmt.Println calls and registers a root-level 404 handler in the API router.

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
third_party/whisper.cpp Updated submodule commit reference
pkg/client/opts.go Renamed opts fields and extended option functions for translation
pkg/client/gowhisper/schema.go Added Stream field to TranslationRequest schema
pkg/client/client.go Hooked up Translate call on gowhisper client and updated request usage
pkg/api/transcribe.go Removed debug fmt import and print statements
pkg/api/register.go Added a root / handler to return a 404 response
Comments suppressed due to low confidence (2)

pkg/client/opts.go:23

  • [nitpick] Consider renaming the opts struct fields to consistent noun-based names, e.g., transcription and translation, for clearer symmetry between the two operations.
	transcribe gowhisper.TranscriptionRequest

pkg/api/register.go:30

  • [nitpick] Avoid manually closing the request body in HTTP handlers; the Go net/http server automatically closes r.Body after the handler returns.
		defer r.Body.Close()

@djthorpe djthorpe merged commit c51a5ad into main Jun 18, 2025
@djthorpe djthorpe deleted the djt-0618-api branch June 18, 2025 06:19
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