Skip to content

Commit

Permalink
upgrade deps
Browse files Browse the repository at this point in the history
  • Loading branch information
zuisong committed Feb 11, 2025
1 parent 64b4b1d commit a55a568
Show file tree
Hide file tree
Showing 10 changed files with 3,802 additions and 876 deletions.
123 changes: 62 additions & 61 deletions deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/main_bun.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ function genModel(req) {
const generateContentRequest = {
contents: openAiMessageToGeminiMessage(req.messages),
generationConfig: {
maxOutputTokens: req.max_tokens ?? void 0,
maxOutputTokens: req.max_completion_tokens ?? void 0,
temperature: req.temperature ?? void 0,
topP: req.top_p ?? void 0,
responseMimeType,
Expand Down
2 changes: 1 addition & 1 deletion dist/main_cloudflare-workers.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ function genModel(req) {
const generateContentRequest = {
contents: openAiMessageToGeminiMessage(req.messages),
generationConfig: {
maxOutputTokens: req.max_tokens ?? void 0,
maxOutputTokens: req.max_completion_tokens ?? void 0,
temperature: req.temperature ?? void 0,
topP: req.top_p ?? void 0,
responseMimeType,
Expand Down
2 changes: 1 addition & 1 deletion dist/main_deno.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ function genModel(req) {
const generateContentRequest = {
contents: openAiMessageToGeminiMessage(req.messages),
generationConfig: {
maxOutputTokens: req.max_tokens ?? void 0,
maxOutputTokens: req.max_completion_tokens ?? void 0,
temperature: req.temperature ?? void 0,
topP: req.top_p ?? void 0,
responseMimeType,
Expand Down
23 changes: 18 additions & 5 deletions dist/main_node.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// node_modules/.deno/@hono[email protected].7/node_modules/@hono/node-server/dist/index.mjs
// node_modules/.deno/@hono[email protected].8/node_modules/@hono/node-server/dist/index.mjs
import { createServer as createServerHTTP } from "http";
import { Http2ServerRequest } from "http2";
import { Readable } from "stream";
Expand Down Expand Up @@ -54,7 +54,16 @@ var newRequestFromIncoming = (method, url, incoming, abortController) => {
return req;
}
if (!(method === "GET" || method === "HEAD")) {
init.body = Readable.toWeb(incoming);
if ("rawBody" in incoming && incoming.rawBody instanceof Buffer) {
init.body = new ReadableStream({
start(controller) {
controller.enqueue(incoming.rawBody);
controller.close();
}
});
} else {
init.body = Readable.toWeb(incoming);
}
}
return new Request2(url, init);
};
Expand Down Expand Up @@ -391,10 +400,14 @@ var getRequestListener = (fetchCallback, options = {}) => {
try {
req = newRequest(incoming, options.hostname);
outgoing.on("close", () => {
const abortController = req[abortControllerKey];
if (!abortController) {
return;
}
if (incoming.errored) {
req[getAbortController]().abort(incoming.errored.toString());
req[abortControllerKey].abort(incoming.errored.toString());
} else if (!outgoing.writableFinished) {
req[getAbortController]().abort("Client connection prematurely closed.");
req[abortControllerKey].abort("Client connection prematurely closed.");
}
});
res = fetchCallback(req, { incoming, outgoing });
Expand Down Expand Up @@ -554,7 +567,7 @@ function genModel(req) {
const generateContentRequest = {
contents: openAiMessageToGeminiMessage(req.messages),
generationConfig: {
maxOutputTokens: req.max_tokens ?? void 0,
maxOutputTokens: req.max_completion_tokens ?? void 0,
temperature: req.temperature ?? void 0,
topP: req.top_p ?? void 0,
responseMimeType,
Expand Down
2 changes: 1 addition & 1 deletion generate-opeapi-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const openapis = [
},
{
data: await fetch(
"https://github.com/zuisong/googleapis-openapi/raw/refs/heads/main/googleapis/generativelanguage/v1beta/generativelanguage-api-openapi_v3.json",
"https://github.com/zuisong/googleapis-openapi/raw/refs/heads/main/googleapis/generativelanguage/v1alpha/generativelanguage-api-openapi_v3.json",
).then((res) => res.text()),
path: "./src/generated-types/gemini-types.ts",
},
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
"test-cov": "deno test --coverage -A --env && deno coverage coverage --lcov --output=coverage/lcov.info"
},
"dependencies": {
"@hono/node-server": "1.13.7",
"@hono/node-server": "1.13.8",
"eventsource-parser": "3.0.0",
"itty-router": "5.0.18"
},
"devDependencies": {
"@total-typescript/ts-reset": "0.6.1",
"esbuild": "0.24.2"
"esbuild": "0.25.0"
},
"engines": {
"node": ">=18.0.0",
Expand Down
Loading

0 comments on commit a55a568

Please sign in to comment.