0.1.153
This commit is contained in:
parent
780d9fdb11
commit
18a7236eff
@ -1,7 +1,7 @@
|
|||||||
[metadata]
|
[metadata]
|
||||||
# replace with your username:
|
# replace with your username:
|
||||||
name = guan
|
name = guan
|
||||||
version = 0.1.152
|
version = 0.1.153
|
||||||
author = guanjihuan
|
author = guanjihuan
|
||||||
author_email = guanjihuan@163.com
|
author_email = guanjihuan@163.com
|
||||||
description = An open source python package
|
description = An open source python package
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
Metadata-Version: 2.2
|
Metadata-Version: 2.2
|
||||||
Name: guan
|
Name: guan
|
||||||
Version: 0.1.152
|
Version: 0.1.153
|
||||||
Summary: An open source python package
|
Summary: An open source python package
|
||||||
Home-page: https://py.guanjihuan.com
|
Home-page: https://py.guanjihuan.com
|
||||||
Author: guanjihuan
|
Author: guanjihuan
|
||||||
|
@ -38,26 +38,26 @@ def chat_with_function_code(function_name, prompt='', model=1, stream=1):
|
|||||||
return response
|
return response
|
||||||
|
|
||||||
# 机器人自动对话
|
# 机器人自动对话
|
||||||
def auto_chat(prompt='你好', round=2):
|
def auto_chat(prompt='你好', round=2, model=1, stream=1):
|
||||||
import guan
|
import guan
|
||||||
response0 = prompt
|
response0 = prompt
|
||||||
for i0 in range(round):
|
for i0 in range(round):
|
||||||
print(f'【对话第 {i0+1} 轮】\n')
|
print(f'【对话第 {i0+1} 轮】\n')
|
||||||
print('机器人 1: ')
|
print('机器人 1: ')
|
||||||
response1 = guan.chat(prompt=response0, stream=1)
|
response1 = guan.chat(prompt=response0, model=model, stream=stream)
|
||||||
print('机器人 2: ')
|
print('机器人 2: ')
|
||||||
response0 = guan.chat(prompt=response1, stream=1)
|
response0 = guan.chat(prompt=response1, model=model, stream=stream)
|
||||||
|
|
||||||
# 机器人自动对话(引导对话)
|
# 机器人自动对话(引导对话)
|
||||||
def auto_chat_with_guide(prompt='你好', guide_message='(回答字数少于30个字,最后反问我一个问题)', round=5):
|
def auto_chat_with_guide(prompt='你好', guide_message='(回答字数少于30个字,最后反问我一个问题)', round=5, model=1, stream=1):
|
||||||
import guan
|
import guan
|
||||||
response0 = prompt
|
response0 = prompt
|
||||||
for i0 in range(round):
|
for i0 in range(round):
|
||||||
print(f'【对话第 {i0+1} 轮】\n')
|
print(f'【对话第 {i0+1} 轮】\n')
|
||||||
print('机器人 1: ')
|
print('机器人 1: ')
|
||||||
response1 = guan.chat(prompt=response0+guide_message, stream=1)
|
response1 = guan.chat(prompt=response0+guide_message, model=model, stream=stream)
|
||||||
print('机器人 2: ')
|
print('机器人 2: ')
|
||||||
response0 = guan.chat(prompt=response1+guide_message, stream=1)
|
response0 = guan.chat(prompt=response1+guide_message, model=model, stream=stream)
|
||||||
|
|
||||||
# 在云端服务器上运行函数(需要函数是独立可运行的代码)
|
# 在云端服务器上运行函数(需要函数是独立可运行的代码)
|
||||||
def run(function_name, *args, **kwargs):
|
def run(function_name, *args, **kwargs):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user