moves keys.ts into keys/key-pool.ts
This commit is contained in:
parent
05ba17e65a
commit
39cdb2e1e8
|
@ -1,7 +1,7 @@
|
|||
import { Request, Response } from "express";
|
||||
import showdown from "showdown";
|
||||
import { config, listConfig } from "./config";
|
||||
import { keys } from "./keys";
|
||||
import { keys } from "./keys/key-pool";
|
||||
import { getUniqueIps } from "./proxy/rate-limit";
|
||||
|
||||
export const handleInfoPage = (req: Request, res: Response) => {
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
round-robin access to keys. Keys are stored in the OPENAI_KEY environment
|
||||
variable, either as a single key, or a base64-encoded JSON array of keys.*/
|
||||
import crypto from "crypto";
|
||||
import { config } from "./config";
|
||||
import { logger } from "./logger";
|
||||
import { config } from "../config";
|
||||
import { logger } from "../logger";
|
||||
|
||||
/** Represents a key stored in the OPENAI_KEY environment variable. */
|
||||
type KeySchema = {
|
|
@ -4,7 +4,7 @@ import util from "util";
|
|||
import zlib from "zlib";
|
||||
import * as httpProxy from "http-proxy";
|
||||
import { logger } from "../logger";
|
||||
import { keys } from "../keys";
|
||||
import { keys } from "../keys/key-pool";
|
||||
|
||||
export const QUOTA_ROUTES = ["/v1/chat/completions"];
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import type { ExpressHttpProxyReqCallback } from ".";
|
||||
import { Key, keys } from "../../keys";
|
||||
import { Key, keys } from "../../keys/key-pool";
|
||||
|
||||
/** Add an OpenAI key from the pool to the request. */
|
||||
export const addKey: ExpressHttpProxyReqCallback = (proxyReq, req) => {
|
||||
|
|
|
@ -3,7 +3,7 @@ import express from "express";
|
|||
import cors from "cors";
|
||||
import pinoHttp from "pino-http";
|
||||
import { logger } from "./logger";
|
||||
import { keys } from "./keys";
|
||||
import { keys } from "./keys/key-pool";
|
||||
import { proxyRouter, rewriteTavernRequests } from "./proxy/routes";
|
||||
import { handleInfoPage } from "./info-page";
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { Express } from "express-serve-static-core";
|
||||
import { Key } from "../keys";
|
||||
import { Key } from "../keys/key-pool";
|
||||
|
||||
declare global {
|
||||
namespace Express {
|
||||
|
|
Loading…
Reference in New Issue