Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
meloalright authored Apr 7, 2024
1 parent 6112fa6 commit 002ebd5
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,46 @@ $ 3body
// > true
```
##### Large Language Model
```shell
智子工程({ "type": <string>, "path": <string>, "prompt": <string> })
```
`properties:`
|property|type|Explanation|
|---|---|---|
|type|string|模型类型|
|path|string|模型所在路径|
|prompt|string|提示词|
`interface:`
|property|type|Explanation|
|---|---|---|
|model|<NativeObject::LLMModel>|模型|
|character|string|提示词所提示的角色|
|infer|BuiltinFunc|执行推理的方法|
|close|BuiltinFunc|关闭会话|
`example:`
```rust
let 智子 = fn () {
let instance = 智子工程({ "type": "llama", "path": "./Vicuna-13B-chinese.bin", "prompt": "你是三体文明的智子" });
return { "回答": fn (问题) { instance.infer(instance, 问题) } }
}();

智子.回答("中国最佳科幻小说是哪个")

// > 推理中...
```
推理示例: [runs/8582743599](https://github.com/rustq/3body-lang/actions/runs/8582743599/job/23521175335#step:5:8796)
## Summary
|Token|3body-lang|Explanation|
Expand Down

0 comments on commit 002ebd5

Please sign in to comment.