llm_old/llm.md

40 lines
553 B
Markdown
Raw Permalink Normal View History

2024-10-02 14:09:54 +08:00
### Configure
#### env.yml
```yaml
llm:
openai:
default:
apiKey: ...
aurze:
apiKey: ...
endpoint: ...
zhipu:
default:
apiKey: ...
```
#### encrypt apiKey
```shell
go install github.com/ssgo/tool/sskey@latest
sskey -e 'your apiKey' | grep 'url base64'
```
js code:
```javascript
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
}
```