Giter Site home page Giter Site logo

book-by-ai's Issues

wsl2,title\index\sections都成功,write直接报错找不到浏览器

win11,wsl2,ubuntu已经安装chrome,win11也安装了。
具体报错如下:

book_cn@write []
请稍候,正在发起搜索请求…
file:///home/pico/BBA/node_modules/@puppeteer/browsers/lib/esm/launch.js:268
reject(new Error([
^

Error: Failed to launch the browser process! spawn /Applications/Google Chrome.app/Contents/MacOS/Google Chrome ENOENT

TROUBLESHOOTING: https://pptr.dev/troubleshooting

at ChildProcess.onClose (file:///home/pico/BBA/node_modules/@puppeteer/browsers/lib/esm/launch.js:268:24)
at ChildProcess.emit (node:events:514:28)
at ChildProcess._handle.onexit (node:internal/child_process:289:12)
at onErrorNT (node:internal/child_process:476:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

Node.js v18.17.1

json 格式解析

使用gpt-3.5-turbo-16k部分情况下会有这个报错,看起来是部分情况下模型返回没有按照 json 格式。

SyntaxError: Unexpected number in JSON at position 48
    at JSON.parse (<anonymous>)
    at canJsonParse (file:///Users/NAME/Code/Github/book-by-ai/lib/functions_cn.js:132:14)
    at extractJSON (file:///Users/NAME/Code/Github/book-by-ai/lib/functions_cn.js:117:24)
    at gen (file:///Users/NAME/Code/Github/book-by-ai/lib/functions_cn.js:70:24)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async GenBook.sections (file:///Users/NAME/Code/Github/book-by-ai/actions/book_cn.js:165:32)
    at async GenBook.main (file:///Users/NAME/Code/Github/book-by-ai/actions/book_cn.js:15:9)
file:///Users/NAME/Code/Github/book-by-ai/actions/book_cn.js:167
                if( result.json.sections )
                                ^

TypeError: Cannot read properties of null (reading 'sections')
    at GenBook.sections (file:///Users/NAME/Code/Github/book-by-ai/actions/book_cn.js:167:33)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async GenBook.main (file:///Users/NAME/Code/Github/book-by-ai/actions/book_cn.js:15:9)

Node.js v18.17.0

[new feat]增加temprature控制变量

因为会从互联网搜索内容进行写作,那也可以用于一般情况的主题搜索和报告了。 但这种一般要求要严谨点,可否增加temprature控制变量。或者像new bing那样,给出精准,平衡,创意 三钟写作模式。

画封面图报错了

Response {
size: 0,
timeout: 0,
[Symbol(Body internals)]: {
body: PassThrough {
_readableState: [ReadableState],
_events: [Object: null prototype],
_eventsCount: 2,
_maxListeners: undefined,
_writableState: [WritableState],
allowHalfOpen: true,
[Symbol(kCapture)]: false,
[Symbol(kCallback)]: null
},
disturbed: false,
error: null
},
[Symbol(Response internals)]: {
url: 'https://oa.api2d.net//sd/v1/generation/stable-diffusion-xl-1024-v1-0/text-to-image',
status: 400,
statusText: 'Bad Request',
headers: Headers { [Symbol(map)]: [Object: null prototype] },
counter: 0
}
}

中文 - gpt3.5-16k模型 - 出现token超出的情况

Error: ChatGPT error 400: {
  "error": {
    "message": "This model's maximum context length is 16385 tokens. However, your messages resulted in 19500 tokens. Please reduce the length of the messages.",
    "type": "invalid_request_error",
    "param": "messages",
    "code": "context_length_exceeded"
  }
}

    at fetchSSE (/node_modules/api2d/cjs/fetchSSE.js:16:23)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async /node_modules/api2d/cjs/index.js:147:38 {

wsl下超时

.env 用的 aiapi配置

AiAPI

OPENAI_API_KEY=sk-1234567890abcdef1234567890abcdef
OPENAI_API_ENDPOINT=http://172.17.128.1:3456
OPENAI_API_MODEL=gpt-3.5-turbo-16k

http://172.17.128.1:3456 这个地址是在AiAPI的 about里复制的,也是通的

wsl下
/mnt/d/book/book-by-ai# curl http://172.17.128.1:3456
AiAPI server works!
后来 换成 http://192.168.0.101:3456 也是通的 ,但都是超时。

用的美国vpn ,claude.ai 可以正常访问

sessionkey 已复制
image

输入了描述后,等半天:

/mnt/d/book/book-by-ai/node_modules/api2d/cjs/index.js:142
reject(new Error([408]:Timeout by ${this.timeout} ms));
^

Error: [408]:Timeout by 300000 ms
at Timeout._onTimeout (/mnt/d/book/book-by-ai/node_modules/api2d/cjs/index.js:142:32)
at listOnTimeout (node:internal/timers:559:17)
at processTimers (node:internal/timers:502:7)

卡在这里
const response = await api.completion({

请问为啥 如何整

Windows 报错

看这个终端问题貌似是路径错了,os:Windows 10
image

[new feat]增加断点重跑功能

运行过程中难免会由于网络,字符长度等问题产生中断,希望能增加断点断续重跑能力,这样能更高效的完成写作。

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.