Remove language and num_speakers from MCP server
- TranscribeRequest now only accepts audio_base64, audio_url, or audio_path. - Hard-code language and num_speakers to None in transcription calls.
This commit is contained in:
+4
-14
@@ -63,14 +63,6 @@ class TranscribeRequest(BaseModel):
|
|||||||
None,
|
None,
|
||||||
description="Internal file path on the server (for internal use only)."
|
description="Internal file path on the server (for internal use only)."
|
||||||
)
|
)
|
||||||
language: Optional[str] = Field(
|
|
||||||
None,
|
|
||||||
description="Optional language hint (e.g., 'english', 'german')."
|
|
||||||
)
|
|
||||||
num_speakers: Optional[int] = Field(
|
|
||||||
None,
|
|
||||||
description="Optional number of speakers for diarization."
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class TranscribeResponse(BaseModel):
|
class TranscribeResponse(BaseModel):
|
||||||
@@ -167,8 +159,6 @@ async def transcribe(req: TranscribeRequest):
|
|||||||
- audio_base64: base64-encoded audio file
|
- audio_base64: base64-encoded audio file
|
||||||
- audio_url: URL to audio file
|
- audio_url: URL to audio file
|
||||||
- audio_path: local file path (for internal use)
|
- audio_path: local file path (for internal use)
|
||||||
- language: (optional)
|
|
||||||
- num_speakers: (optional)
|
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
{
|
{
|
||||||
@@ -204,8 +194,8 @@ async def transcribe(req: TranscribeRequest):
|
|||||||
process_mcp_transcribe_task.delay(
|
process_mcp_transcribe_task.delay(
|
||||||
audio_path=file_path,
|
audio_path=file_path,
|
||||||
job_id=job_id,
|
job_id=job_id,
|
||||||
language=req.language or None,
|
language=None,
|
||||||
num_speakers=int(req.num_speakers) if req.num_speakers else None,
|
num_speakers=None,
|
||||||
)
|
)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error("Error enqueuing MCP job: %s", e)
|
logger.error("Error enqueuing MCP job: %s", e)
|
||||||
@@ -243,8 +233,8 @@ async def transcribe(req: TranscribeRequest):
|
|||||||
scraibe = Scraibe(verbose=False)
|
scraibe = Scraibe(verbose=False)
|
||||||
result = scraibe.transcribe(
|
result = scraibe.transcribe(
|
||||||
audio_file=file_path,
|
audio_file=file_path,
|
||||||
language=req.language or None,
|
language=None,
|
||||||
num_speakers=int(req.num_speakers) if req.num_speakers else None,
|
num_speakers=None,
|
||||||
verbose=False,
|
verbose=False,
|
||||||
for_export=True,
|
for_export=True,
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user