llm_old/llm.md
2024-10-02 14:09:54 +08:00

553 B

Configure

env.yml

llm:
  openai:
    default:
      apiKey: ...
    aurze:
      apiKey: ...
      endpoint: ...
  zhipu:
    default:
      apiKey: ...

encrypt apiKey

go install github.com/ssgo/tool/sskey@latest
sskey -e 'your apiKey' | grep 'url base64'

js code:

import {zhipu, aurze} from 'llm'
import console from 'console'

function main(...args) {
    let r = zhipu.fastAsk((args.length>0?args[0]:'你好', r => {
        console.print(r)
    })
    console.println()
    return r
}