diff --git a/Dockerfile b/Dockerfile index f4dfa9d..5017815 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,7 +8,7 @@ RUN npm i -g pnpm@9.1.4 COPY package.json ./ -COPY patches ./patches +#COPY patches ./patches RUN pnpm install diff --git a/README.md b/README.md index b96a19c..ce802ef 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ https://developers.cloudflare.com/workers-ai/models/ | CF_TOKEN | Cloudflare Workers AI Token | | CF_GATEWAY | Cloudflare AI Gateway URL | | OPENAI_API_KEY | OpenAI API Key (需要ChatGPT时填写) | -| G_API_KEY | Google AI API Key (需要GeminiPro时填写) | +| G_API_KEY | Google AI API Key (需要GeminiPro时填写) | | PASSWORD | 访问密码 (可选) | #### CF_TOKEN @@ -64,6 +64,8 @@ https://dash.cloudflare.com/profile/api-tokens - 单击创建令牌 - 复制您的令牌,设置环境变量 +示例:https://gateway.ai.cloudflare.com/v1/A484BCC718B10B73022BFE2D9AB49776/myai + #### CF_GATEWAY https://dash.cloudflare.com/ diff --git a/package.json b/package.json index 2403557..9c7d019 100644 --- a/package.json +++ b/package.json @@ -27,10 +27,5 @@ "highlight.js": "^11.9.0", "markdown-it": "^14.1.0" }, - "packageManager": "pnpm@9.1.4+sha512.9df9cf27c91715646c7d675d1c9c8e41f6fce88246f1318c1aa6a1ed1aeb3c4f032fcdf4ba63cc69c4fe6d634279176b5358727d8f2cc1e65b65f43ce2f8bfb0", - "pnpm": { - "patchedDependencies": { - "@google/generative-ai@0.12.0": "patches/@google__generative-ai@0.12.0.patch" - } - } + "packageManager": "pnpm@9.1.4+sha512.9df9cf27c91715646c7d675d1c9c8e41f6fce88246f1318c1aa6a1ed1aeb3c4f032fcdf4ba63cc69c4fe6d634279176b5358727d8f2cc1e65b65f43ce2f8bfb0" } diff --git a/patches/@google__generative-ai@0.12.0.patch b/patches/@google__generative-ai@0.12.0.patch deleted file mode 100644 index 6db2294..0000000 --- a/patches/@google__generative-ai@0.12.0.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff --git a/dist/index.js b/dist/index.js -index 4290f816871d5e88e44e264fa47b2960cde864a7..64647480b2d600d8f163a15ef7ce49920b04bae5 100644 ---- a/dist/index.js -+++ b/dist/index.js -@@ -241,7 +241,7 @@ class GoogleGenerativeAIRequestInputError extends GoogleGenerativeAIError { - * See the License for the specific language governing permissions and - * limitations under the License. - */ --const DEFAULT_BASE_URL = "https://generativelanguage.googleapis.com"; -+const DEFAULT_BASE_URL = process.env.G_API_URL || "https://generativelanguage.googleapis.com"; - const DEFAULT_API_VERSION = "v1beta"; - /** - * We can't `require` package.json if this runs on web. We will use rollup to -diff --git a/dist/index.mjs b/dist/index.mjs -index aabb1c97ad6ec5af1e8e736da9d3dc23c478cb09..b02db137b30e5f77e7a5d68657b1fbc19581c8f2 100644 ---- a/dist/index.mjs -+++ b/dist/index.mjs -@@ -239,7 +239,7 @@ class GoogleGenerativeAIRequestInputError extends GoogleGenerativeAIError { - * See the License for the specific language governing permissions and - * limitations under the License. - */ --const DEFAULT_BASE_URL = "https://generativelanguage.googleapis.com"; -+const DEFAULT_BASE_URL = process.env.G_API_URL || "https://generativelanguage.googleapis.com"; - const DEFAULT_API_VERSION = "v1beta"; - /** - * We can't `require` package.json if this runs on web. We will use rollup to