mirror of
https://github.com/simstudioai/sim.git
synced 2026-01-09 15:07:55 -05:00
v0.2.1: fix + chore (#585)
* fix: icon properties error * chore(ci): run ci on staging + migrations (#575) * fix: eleven labs deployment returning uploaded blob (#583) * fix(eleven-labs): fixed URL path (#584) * fix: eleven labs deployment returning uploaded blob * fix: added better URL pattern --------- Co-authored-by: Aditya Tripathi <aditya@climactic.co>
This commit is contained in:
8
.github/workflows/ci.yml
vendored
8
.github/workflows/ci.yml
vendored
@@ -2,9 +2,9 @@ name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
branches: [main, staging]
|
||||
pull_request:
|
||||
branches: [main]
|
||||
branches: [main, staging]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
@@ -56,7 +56,7 @@ jobs:
|
||||
migrations:
|
||||
name: Apply Database Migrations
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
||||
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/staging')
|
||||
needs: test
|
||||
steps:
|
||||
- name: Checkout code
|
||||
@@ -73,5 +73,5 @@ jobs:
|
||||
- name: Apply migrations
|
||||
working-directory: ./apps/sim
|
||||
env:
|
||||
DATABASE_URL: ${{ secrets.DATABASE_URL }}
|
||||
DATABASE_URL: ${{ github.ref == 'refs/heads/main' && secrets.DATABASE_URL || secrets.STAGING_DATABASE_URL }}
|
||||
run: bunx drizzle-kit push
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import { NextResponse } from 'next/server'
|
||||
import { createLogger } from '@/lib/logs/console-logger'
|
||||
import { uploadFile } from '@/lib/uploads/storage-client'
|
||||
import { getBaseUrl } from '@/lib/urls/utils'
|
||||
|
||||
const logger = createLogger('ProxyTTSAPI')
|
||||
|
||||
@@ -44,12 +46,18 @@ export async function POST(request: Request) {
|
||||
return new NextResponse('Empty audio received', { status: 422 })
|
||||
}
|
||||
|
||||
return new NextResponse(audioBlob, {
|
||||
headers: {
|
||||
'Content-Type': 'audio/mpeg',
|
||||
'Cache-Control': 'public, max-age=86400', // Cache for a day
|
||||
'Access-Control-Allow-Origin': '*', // CORS support
|
||||
},
|
||||
// Upload the audio file to storage and return multiple URL options
|
||||
const audioBuffer = Buffer.from(await audioBlob.arrayBuffer())
|
||||
const timestamp = Date.now()
|
||||
const fileName = `elevenlabs-tts-${timestamp}.mp3`
|
||||
const fileInfo = await uploadFile(audioBuffer, fileName, 'audio/mpeg')
|
||||
|
||||
// Generate the full URL for external use using the configured base URL
|
||||
const audioUrl = `${getBaseUrl()}${fileInfo.path}`
|
||||
|
||||
return NextResponse.json({
|
||||
audioUrl,
|
||||
size: fileInfo.size,
|
||||
})
|
||||
} catch (error) {
|
||||
logger.error('Error proxying TTS:', error)
|
||||
|
||||
@@ -3014,11 +3014,11 @@ export const AzureIcon = (props: SVGProps<SVGSVGElement>) => (
|
||||
y2='11.8734'
|
||||
gradientUnits='userSpaceOnUse'
|
||||
>
|
||||
<stop stop-opacity='0.3' />
|
||||
<stop offset='0.0711768' stop-opacity='0.2' />
|
||||
<stop offset='0.321031' stop-opacity='0.1' />
|
||||
<stop offset='0.623053' stop-opacity='0.05' />
|
||||
<stop offset='1' stop-opacity='0' />
|
||||
<stop stopOpacity='0.3' />
|
||||
<stop offset='0.0711768' stopOpacity='0.2' />
|
||||
<stop offset='0.321031' stopOpacity='0.1' />
|
||||
<stop offset='0.623053' stopOpacity='0.05' />
|
||||
<stop offset='1' stopOpacity='0' />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id='paint2_linear_6102_134469'
|
||||
|
||||
@@ -55,14 +55,12 @@ export const elevenLabsTtsTool: ToolConfig<ElevenLabsTtsParams, ElevenLabsTtsRes
|
||||
throw new Error(`ElevenLabs API error: ${response.status} ${response.statusText}`)
|
||||
}
|
||||
|
||||
// Create a blob URL that can be used in an audio player
|
||||
const audioBlob = await response.blob()
|
||||
const audioUrl = URL.createObjectURL(audioBlob)
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
audioUrl,
|
||||
audioUrl: data.audioUrl,
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user