Giter Site home page Giter Site logo

ourongxing / chatgpt-vercel Goto Github PK

View Code? Open in Web Editor NEW
3.1K 17.0 3.1K 6.12 MB

Elegant and Powerfull. Powered by OpenAI and Vercel.

Home Page: https://vercel-chatgpt-github.vercel.app/

License: MIT License

TypeScript 99.55% CSS 0.45%
chatgpt vercel edge-function solidjs

chatgpt-vercel's Introduction

chatgpt-vercel's People

Contributors

1wkk avatar bkyaro avatar boynchan avatar ddiu8081 avatar gowxx avatar hulog avatar likenttt avatar linlin00000000 avatar ourongxing avatar tsingyi1263 avatar yicaoli avatar yorunning avatar youhunwl avatar yzh990918 avatar zhangnew avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chatgpt-vercel's Issues

模型选择问题

能否就是在下面的设置处,可以添加模型选择,然后根据不同的任务选择不同的模型,然后来执行之后的操作

希望增加删除单条问答记录的功能

在需要连续对话的场景,有时一些历史消息是我们不需要提供给api的。目前只有清除整个消息记录的功能,需要携带部分上下文时就满足不了需求了。希望大佬加下

 ERR_PNPM_OUTDATED_LOCKFILE  Cannot install with "frozen-lockfile" because pnpm-lock.yaml is not up-to-date with package.json

加了一个gitalk 评论插件 重新部署后,出现下面错误,框架不熟,求大佬指教

 ERR_PNPM_OUTDATED_LOCKFILE  Cannot install with "frozen-lockfile" because pnpm-lock.yaml is not up-to-date with package.json
Note that in CI environments this setting is true by default. If you still need to run install in such cases, use "pnpm install --no-frozen-lockfile"

image

手机端复制无效

在手机上使用,点对话右上角复制,提示复制成功,实际没有复制上。

markdown导出功能

个人部署后无法使用导出markdown功能,导出图片功能可正常使用

添加可用余额展示

希望页面上增加一个可用余额的展示,该接口请求方式如下:

$ curl -s  "https://api.openai.com/dashboard/billing/credit_grants" \
--header 'Content-type: application/json' \
--header 'Authorization: Bearer api_key' | jq    这里替换api_key
{
  "object": "credit_summary",
  "total_granted": 18,
  "total_used": 0.178104,  # 已用
  "total_available": 17.821896,  # 剩余可用余额
  "grants": {
    "object": "list",
    "data": [
      {
        "object": "credit_grant",
        "id": "be32c280-ad4a-4e14-bc1a-077a32275f9e",
        "grant_amount": 18,
        "used_amount": 0.178104,
        "effective_at": 1677628800,
        "expires_at": 1688169600
      }
    ]
  }
}

fetch error

我本地部署的, 频繁的 出现下面的错误:

image

新版本速度问题

更新到最新版本之后,相应的速度下降了不少,我还是回退到之前部署的版本上面了

请问prompt在哪里找啊?

如题,还有这个预设可以自己写一个设定,直接在对话开头发给chat吗?还是说需要把写的设定设置到系统角色里?

TypeError An error occurred. --- fetch failed

WeChatba6eb839fe006f7924577891e6d85fe9


输入问题后,一直提示这个问题

env中加入这个:HTTPS_PROXY=http://127.0.0.1:15235
一样也是连接不成功,求解谢谢


import type { APIRoute } from "astro"
import {
createParser,
ParsedEvent,
ReconnectInterval
} from "eventsource-parser"

const apiKeys = (
import.meta.env.OPENAI_API_KEY?.split(/\s*|\s*/) ?? []
).filter(Boolean)

export const post: APIRoute = async context => {
const body = await context.request.json()
const apiKey = apiKeys.length
? apiKeys[Math.floor(Math.random() * apiKeys.length)]
: ""
let { messages, key = apiKey, temperature = 0.6 } = body

const encoder = new TextEncoder()
const decoder = new TextDecoder()
^

if (!key.startsWith("sk-")) key = apiKey
if (!key) {
return new Response("没有填写 OpenAI API key")
}
if (!messages) {
return new Response("没有输入任何文字")
}

const completion = await fetch("https://api.openai.com/v1/chat/completions", {
headers: {
"Content-Type": "application/json",
Authorization: Bearer ${key}
},
method: "POST",
body: JSON.stringify({
model: "gpt-3.5-turbo",
messages,
temperature,
stream: true
})
})

const stream = new ReadableStream({
async start(controller) {
const streamParser = (event: ParsedEvent | ReconnectInterval) => {
if (event.type === "event") {
const data = event.data
if (data === "[DONE]") {
controller.close()
return
}
try {
// response = {
// id: 'chatcmpl-6pULPSegWhFgi0XQ1DtgA3zTa1WR6',
// object: 'chat.completion.chunk',
// created: 1677729391,
// model: 'gpt-3.5-turbo-0301',
// choices: [
// { delta: { content: '你' }, index: 0, finish_reason: null }
// ],
// }
const json = JSON.parse(data)
const text = json.choices[0].delta?.content
const queue = encoder.encode(text)
controller.enqueue(queue)
} catch (e) {
controller.error(e)
}
}
}

  const parser = createParser(streamParser)
  for await (const chunk of completion.body as any) {
    parser.feed(decoder.decode(chunk))
  }
}

})

return new Response(stream)
}

功能添加

大佬可以加个屏蔽词功能吗
就是设置某个屏蔽词然后转成另外一个词
然后可以设置多个的那种

Run `npm config delete prefix` or `nvm use --delete-prefix v18.0.0` to unset it.

使用CloudFlare配置Pages项目,刚开始提示Node版本过低,升级Node版本为18.0.0后,出现另外一个错误,如下:

-- | --
20:24:42.689 | Installing dependencies
20:24:42.700 | Python version set to 2.7
20:24:46.058 | Downloading and installing node v18.0.0...
20:24:46.551 | Downloading https://nodejs.org/dist/v18.0.0/node-v18.0.0-linux-x64.tar.xz...
20:24:46.986 | Computing checksum with sha256sum
20:24:47.120 | Checksums matched!
20:24:51.354 | node: /lib/x86_64-linux-gnu/libm.so.6: version GLIBC_2.27' not found (required by node) 20:24:51.354 | node: /lib/x86_64-linux-gnu/libc.so.6: version GLIBC_2.25' not found (required by node)
20:24:51.355 | node: /lib/x86_64-linux-gnu/libc.so.6: version GLIBC_2.28' not found (required by node) 20:24:51.405 | nvm is not compatible with the npm config "prefix" option: currently set to "" 20:24:51.407 | Run npm config delete prefixornvm use --delete-prefix v18.0.0` to unset it.
20:24:51.407 | Failed to install node version '18.0.0'
20:24:51.411 | Failed: build command exited with code: 1
20:24:52.194 | Failed: an internal error occurred

因为在CloudFlare,只能配置npm run build的配置,没办法解决npm和nvm的冲突,有其他人遇到吗

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.