-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Neko Ayaka <[email protected]>
- Loading branch information
1 parent
f2fe7a8
commit 912aa25
Showing
13 changed files
with
178 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
import process from 'node:process';globalThis._importMeta_={url:import.meta.url,env:process.env};import { getRequestHeader, splitCookiesString, setResponseStatus, setResponseHeader, send, getRequestHeaders, defineEventHandler, handleCacheHeaders, createEvent, fetchWithEvent, isEvent, eventHandler, setHeaders, sendRedirect, proxyRequest, createApp, createRouter as createRouter$1, toNodeListener, lazyEventHandler, getResponseStatus, setResponseHeaders, createError, getRouterParam, getQuery as getQuery$1, readBody, getResponseStatusText } from 'file:///Users/neko/Git/nekomeowww/airi-vtuber/node_modules/.pnpm/[email protected]/node_modules/h3/dist/index.mjs'; | ||
import process from 'node:process';globalThis._importMeta_={url:import.meta.url,env:process.env};import { getRequestHeader, splitCookiesString, setResponseStatus, setResponseHeader, send, getRequestHeaders, defineEventHandler, handleCacheHeaders, createEvent, fetchWithEvent, isEvent, eventHandler, setHeaders, sendRedirect, proxyRequest, createApp, createRouter as createRouter$1, toNodeListener, lazyEventHandler, getResponseStatus, setResponseHeaders, createError, getRouterParam, getQuery as getQuery$1, readBody, sendStream, getResponseStatusText } from 'file:///Users/neko/Git/nekomeowww/airi-vtuber/node_modules/.pnpm/[email protected]/node_modules/h3/dist/index.mjs'; | ||
import { Server } from 'node:http'; | ||
import { mkdirSync } from 'node:fs'; | ||
import { tmpdir } from 'node:os'; | ||
import { join } from 'node:path'; | ||
import { parentPort, threadId } from 'node:worker_threads'; | ||
import { ElevenLabsClient } from 'file:///Users/neko/Git/nekomeowww/airi-vtuber/node_modules/.pnpm/[email protected]/node_modules/elevenlabs/index.js'; | ||
import { getRequestDependencies, getPreloadLinks, getPrefetchLinks, createRenderer } from 'file:///Users/neko/Git/nekomeowww/airi-vtuber/node_modules/.pnpm/[email protected]/node_modules/vue-bundle-renderer/dist/runtime.mjs'; | ||
import { stringify, uneval } from 'file:///Users/neko/Git/nekomeowww/airi-vtuber/node_modules/.pnpm/[email protected]/node_modules/devalue/index.js'; | ||
import destr from 'file:///Users/neko/Git/nekomeowww/airi-vtuber/node_modules/.pnpm/[email protected]/node_modules/destr/dist/index.mjs'; | ||
|
@@ -280,11 +281,11 @@ _FqXo62o6um, | |
_XwmoL2xytk | ||
]; | ||
|
||
const _lazy_RvIs71 = () => Promise.resolve().then(function () { return pageview$1; }); | ||
const _lazy_Gb4bMB = () => Promise.resolve().then(function () { return tts$1; }); | ||
const _lazy_gokVod = () => Promise.resolve().then(function () { return renderer$1; }); | ||
|
||
const handlers = [ | ||
{ route: '/api/pageview', handler: _lazy_RvIs71, lazy: true, middleware: false, method: undefined }, | ||
{ route: '/api/v1/llm/tts', handler: _lazy_Gb4bMB, lazy: true, middleware: false, method: undefined }, | ||
{ route: '/__nuxt_error', handler: _lazy_gokVod, lazy: true, middleware: false, method: undefined }, | ||
{ route: '/**', handler: _lazy_gokVod, lazy: true, middleware: false, method: undefined } | ||
]; | ||
|
@@ -1103,16 +1104,33 @@ const errorDev = /*#__PURE__*/Object.freeze({ | |
template: template$1 | ||
}); | ||
|
||
const startAt = Date.now(); | ||
let count = 0; | ||
const pageview = defineEventHandler(() => ({ | ||
pageview: count++, | ||
startAt | ||
})); | ||
const tts = defineEventHandler(async (event) => { | ||
const body = await readBody(event); | ||
const client = new ElevenLabsClient({ | ||
apiKey: "" | ||
}); | ||
const res = await client.generate({ | ||
// voice: 'ShanShan', | ||
// Quite good for English | ||
voice: "Myriam", | ||
// Beatrice is not 'childish' like the others | ||
// voice: 'Beatrice', | ||
text: body.text, | ||
stream: true, | ||
model_id: "eleven_multilingual_v2", | ||
voice_settings: { | ||
stability: 0.4, | ||
similarity_boost: 0.5 | ||
} | ||
}); | ||
event.node.res.setHeader("Content-Type", "audio/mpeg"); | ||
event.node.res.setHeader("Transfer-Encoding", "chunked"); | ||
return sendStream(event, res); | ||
}); | ||
|
||
const pageview$1 = /*#__PURE__*/Object.freeze({ | ||
const tts$1 = /*#__PURE__*/Object.freeze({ | ||
__proto__: null, | ||
default: pageview | ||
default: tts | ||
}); | ||
|
||
const Vue3 = version[0] === "3"; | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"id":"dev","timestamp":1733141803112} | ||
{"id":"dev","timestamp":1733143340735} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"id":"dev","timestamp":1733141803112,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]} | ||
{"id":"dev","timestamp":1733143340735,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,12 +3,12 @@ import type { Serialize, Simplify } from "nitropack/types"; | |
declare module "nitropack/types" { | ||
type Awaited<T> = T extends PromiseLike<infer U> ? Awaited<U> : T | ||
interface InternalApi { | ||
'/api/pageview': { | ||
'default': Simplify<Serialize<Awaited<ReturnType<typeof import('../../server/api/pageview').default>>>> | ||
'/api/v1/llm/tts': { | ||
'default': Simplify<Serialize<Awaited<ReturnType<typeof import('../../server/api/v1/llm/voice/text-to-speech').default>>>> | ||
} | ||
'/__nuxt_error': { | ||
'default': Simplify<Serialize<Awaited<ReturnType<typeof import('../../node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected]__ioredis@5._dnsf4ozg37sim4qflnckqfichq/node_modules/nuxt/dist/core/runtime/nitro/renderer').default>>>> | ||
} | ||
} | ||
} | ||
export {} | ||
export {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,5 +62,8 @@ | |
"vue-tsc": "^2.1.10", | ||
"yauzl": "^3.2.0", | ||
"zod": "^3.23.8" | ||
}, | ||
"dependencies": { | ||
"elevenlabs": "^0.18.1" | ||
} | ||
} |
Oops, something went wrong.