mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-25 19:19:28 +00:00
feat: remove all ai transcription related code and schema
This commit is contained in:
@@ -25,7 +25,7 @@ export class AgentService {
|
||||
skills,
|
||||
} = params
|
||||
|
||||
if (type === 'embedding' || type === 'transcription' || type === 'autofill') {
|
||||
if (type === 'embedding' || type === 'autofill') {
|
||||
const existing = await this.prismaClient.agent.findFirst({
|
||||
where: {
|
||||
type,
|
||||
@@ -129,7 +129,7 @@ export class AgentService {
|
||||
|
||||
if (!agent) throw new Error('agent not found')
|
||||
|
||||
if (type === 'embedding' || type === 'transcription' || type === 'autofill') {
|
||||
if (type === 'embedding' || type === 'autofill') {
|
||||
const existing = await this.prismaClient.agent.findFirst({
|
||||
where: {
|
||||
type,
|
||||
|
||||
@@ -24,15 +24,6 @@ export class ElevenLabsProvider implements Provider {
|
||||
}
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
async transcribe(model: string, _audioBuffer: Buffer): Promise<{ text: string; usage: Usage }> {
|
||||
// TODO: Implement ElevenLabs transcribe
|
||||
return {
|
||||
text: 'elevenlabs transcription',
|
||||
usage: { model, inputTokens: 0, outputTokens: 0 },
|
||||
}
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
async generateImageEmbedding(_model: string, _imageBuffer: Buffer): Promise<number[]> {
|
||||
throw new Error('Not implemented')
|
||||
|
||||
@@ -67,15 +67,6 @@ export class GeminiProvider implements Provider {
|
||||
return { text: result.text || '', usage }
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
async transcribe(model: string, _audioBuffer: Buffer): Promise<{ text: string; usage: Usage }> {
|
||||
// TODO: Implement Gemini transcribe
|
||||
return {
|
||||
text: 'gemini transcription',
|
||||
usage: { model, inputTokens: 0, outputTokens: 0 },
|
||||
}
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
async generateImageEmbedding(_model: string, _imageBuffer: Buffer): Promise<number[]> {
|
||||
throw new Error('Not implemented')
|
||||
|
||||
@@ -76,15 +76,6 @@ export class OpenAiProvider implements Provider {
|
||||
return { text: chat.choices[0].message.content || '', usage }
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
async transcribe(model: string, _audioBuffer: Buffer): Promise<{ text: string; usage: Usage }> {
|
||||
// TODO: Implement OpenAI transcribe
|
||||
return {
|
||||
text: 'openai transcription',
|
||||
usage: { model, inputTokens: 0, outputTokens: 0 },
|
||||
}
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
async generateImageEmbedding(_model: string, _imageBuffer: Buffer): Promise<number[]> {
|
||||
throw new Error('Not implemented')
|
||||
|
||||
@@ -13,8 +13,6 @@ export interface Provider {
|
||||
schema?: any,
|
||||
): Promise<{ text: string; usage: Usage }>
|
||||
|
||||
transcribe(model: string, audioBuffer: Buffer): Promise<{ text: string; usage: Usage }>
|
||||
|
||||
generateImageEmbedding(model: string, imageBuffer: Buffer): Promise<number[]>
|
||||
|
||||
generateVideoEmbedding(model: string, videoBuffer: Buffer): Promise<number[]>
|
||||
|
||||
@@ -262,30 +262,6 @@ export class UploadService {
|
||||
})
|
||||
}
|
||||
|
||||
const transcriptionAgent = await tx.agent.findFirst({
|
||||
where: {
|
||||
type: 'transcription',
|
||||
enabled: true,
|
||||
user: { teamMembers: { some: { teamId: team.id } } },
|
||||
},
|
||||
})
|
||||
|
||||
if (transcriptionAgent) {
|
||||
await tx.workflowTask.create({
|
||||
data: {
|
||||
assetId: asset.id,
|
||||
type: WorkflowTaskType.ai_transcription,
|
||||
status: WorkflowTaskStatus.pending,
|
||||
teamId: team.id,
|
||||
projectId: asset.projectId,
|
||||
payload: {
|
||||
projectId: asset.projectId!,
|
||||
agent: { agentId: transcriptionAgent.id },
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
// Ai Embedding if enabled via agent
|
||||
const embeddingAgent = await tx.agent.findFirst({
|
||||
where: {
|
||||
|
||||
Reference in New Issue
Block a user