mirror of
https://github.com/enricoros/big-AGI.git
synced 2026-05-10 21:50:14 -07:00
Partially revert 2894c070 - fixed by the tRPC upgrade
This commit is contained in:
@@ -2,7 +2,6 @@ import { z } from 'zod';
|
||||
|
||||
import { createEmptyReadableStream, createServerDebugWireEvents, safeErrorString, serverCapitalizeFirstLetter } from '~/server/wire';
|
||||
import { createTRPCRouter, publicProcedure } from '~/server/trpc/trpc.server';
|
||||
import { delayPostAsyncGeneratorOnEdge } from '~/server/trpc/trpc.next-edge';
|
||||
import { fetchResponseOrTRPCThrow } from '~/server/trpc/trpc.router.fetchers';
|
||||
|
||||
import { AixDemuxers } from '../dispatch/stream.demuxers';
|
||||
@@ -38,7 +37,7 @@ export const aixRouter = createTRPCRouter({
|
||||
streaming: z.boolean(),
|
||||
connectionOptions: AixWire_API.ConnectionOptions_schema.optional(),
|
||||
}))
|
||||
.mutation(delayPostAsyncGeneratorOnEdge(0, async function* ({ input, ctx }): AsyncGenerator<AixWire_Particles.ChatGenerateOp> {
|
||||
.mutation(async function* ({ input, ctx }): AsyncGenerator<AixWire_Particles.ChatGenerateOp> {
|
||||
|
||||
|
||||
// Intake derived state
|
||||
@@ -236,6 +235,6 @@ export const aixRouter = createTRPCRouter({
|
||||
// or an error that has already been queued up for this last flush
|
||||
yield* chatGenerateTx.flushParticles();
|
||||
|
||||
})),
|
||||
}),
|
||||
|
||||
});
|
||||
|
||||
@@ -6,7 +6,6 @@ import { default as TurndownService } from 'turndown';
|
||||
import { load as cheerioLoad } from 'cheerio';
|
||||
|
||||
import { createTRPCRouter, publicProcedure } from '~/server/trpc/trpc.server';
|
||||
import { delayPostAsyncGeneratorOnEdge } from '~/server/trpc/trpc.next-edge';
|
||||
import { env } from '~/server/env';
|
||||
|
||||
import { workerPuppeteerDownloadFileOrThrow } from './browse.files';
|
||||
@@ -72,7 +71,7 @@ export const browseRouter = createTRPCRouter({
|
||||
|
||||
fetchPagesStreaming: publicProcedure
|
||||
.input(fetchPageInputSchema)
|
||||
.mutation(delayPostAsyncGeneratorOnEdge(0, async function* ({ input: { access, requests } }) {
|
||||
.mutation(async function* ({ input: { access, requests } }) {
|
||||
|
||||
// get endpoint
|
||||
const endpoint = (access.wssEndpoint || env.PUPPETEER_WSS_ENDPOINT || '').trim();
|
||||
@@ -117,7 +116,7 @@ export const browseRouter = createTRPCRouter({
|
||||
pages,
|
||||
workerHost,
|
||||
};
|
||||
})),
|
||||
}),
|
||||
|
||||
});
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ import { z } from 'zod';
|
||||
import { createTRPCRouter, publicProcedure } from '~/server/trpc/trpc.server';
|
||||
import { env } from '~/server/env';
|
||||
import { fetchJsonOrTRPCThrow, fetchResponseOrTRPCThrow } from '~/server/trpc/trpc.router.fetchers';
|
||||
import { delayPostAsyncGeneratorOnEdge } from '~/server/trpc/trpc.next-edge';
|
||||
|
||||
|
||||
// configuration
|
||||
@@ -81,7 +80,7 @@ export const elevenlabsRouter = createTRPCRouter({
|
||||
*/
|
||||
speech: publicProcedure
|
||||
.input(speechInputSchema)
|
||||
.mutation(delayPostAsyncGeneratorOnEdge(0, async function* ({ input: { xiKey, text, voiceId, nonEnglish, audioStreaming, audioTurbo }, ctx }) {
|
||||
.mutation(async function* ({ input: { xiKey, text, voiceId, nonEnglish, audioStreaming, audioTurbo }, ctx }) {
|
||||
|
||||
// start streaming back
|
||||
yield { control: 'start' };
|
||||
@@ -183,7 +182,7 @@ export const elevenlabsRouter = createTRPCRouter({
|
||||
|
||||
// end streaming (if a control error wasn't thrown)
|
||||
yield { control: 'end' };
|
||||
})),
|
||||
}),
|
||||
|
||||
});
|
||||
|
||||
|
||||
@@ -30,7 +30,6 @@ import { perplexityAIModelDescriptions, perplexityAIModelSort } from './models/p
|
||||
import { togetherAIModelsToModelDescriptions } from './models/together.models';
|
||||
import { wilreLocalAIModelsApplyOutputSchema, wireLocalAIModelsAvailableOutputSchema, wireLocalAIModelsListOutputSchema } from './localai.wiretypes';
|
||||
import { xaiModelDescriptions, xaiModelSort } from './models/xai.models';
|
||||
import { delayPostAsyncGeneratorOnEdge } from '~/server/trpc/trpc.next-edge';
|
||||
|
||||
|
||||
const openAIDialects = z.enum([
|
||||
@@ -275,7 +274,7 @@ export const llmOpenAIRouter = createTRPCRouter({
|
||||
/* [OpenAI/LocalAI] images/generations */
|
||||
createImages: publicProcedure
|
||||
.input(createImagesInputSchema)
|
||||
.mutation(delayPostAsyncGeneratorOnEdge(0, async function* ({ input }): AsyncGenerator<T2ICreateImageAsyncStreamOp> {
|
||||
.mutation(async function* ({ input }): AsyncGenerator<T2ICreateImageAsyncStreamOp> {
|
||||
|
||||
const { access, generationConfig: config, editConfig } = input;
|
||||
|
||||
@@ -395,7 +394,7 @@ export const llmOpenAIRouter = createTRPCRouter({
|
||||
},
|
||||
};
|
||||
}
|
||||
})),
|
||||
}),
|
||||
|
||||
|
||||
/* [OpenAI] check for content policy violations */
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
import { createTRPCRouter, publicProcedure } from '~/server/trpc/trpc.server';
|
||||
import { delayPostAsyncGeneratorOnEdge } from '~/server/trpc/trpc.next-edge';
|
||||
import { env } from '~/server/env';
|
||||
import { fetchResponseOrTRPCThrow } from '~/server/trpc/trpc.router.fetchers';
|
||||
|
||||
@@ -28,7 +27,7 @@ export const prodiaRouter = createTRPCRouter({
|
||||
height: z.number().optional(),
|
||||
seed: z.number().optional(),
|
||||
}))
|
||||
.query(delayPostAsyncGeneratorOnEdge(0, async function* ({ input }): AsyncGenerator<T2ICreateImageAsyncStreamOp> {
|
||||
.query(async function* ({ input }): AsyncGenerator<T2ICreateImageAsyncStreamOp> {
|
||||
|
||||
const key = (input.prodiaKey || env.PRODIA_API_KEY || '').trim();
|
||||
if (!key)
|
||||
@@ -139,6 +138,6 @@ export const prodiaRouter = createTRPCRouter({
|
||||
},
|
||||
};
|
||||
|
||||
})),
|
||||
}),
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user