function App() {
const sessionList = [
{
id: "2",
message: "开始会话后,这里就会显示第一句话,如果太长",
status: 0,
question: "1+1=?",
tools: [
{
args: {
text: "```python\ndef solution():\n answer = cucl()\n return answer\n```",
},
errmsg: "NameError(\"name 'cucl' is not defined\")",
result: null,
state: -10002,
thought:
"这段代码定义了一个名为 cucl 的函数,它返回 1 + 1 的结果,即 2。",
type: "PythonExecutor",
url: "http://python-executor-service.cloud-dev:8210/inference",
valid: 0,
},
{
args: {
text: "```python\ndef solution():\n def cucl():\n return 1 + 1\n answer = cucl()\n return answer\n```",
},
errmsg: "",
result: {
text: "2",
},
state: 0,
thought:
"这段代码定义了一个名为 cucl 的函数,它返回 1 + 1 的结果,即 2。",
type: "PythonExecutor",
url: "http://python-executor-service.cloud-dev:8210/inference",
valid: 0,
},
],
},
{
id: "3",
message: "开始会话后,这里就会显示第一句话,如果太长",
status: 0,
question: "搜索上海天气",
tools: [
{
args: {
text: "上海天气",
},
errmsg: "",
result: {
origin: [
{
note: "directly return answerBox, thx google !",
origin: {
answer: "85°F",
title:
"Fudan University, 220 Handan Road, Yangpu District, Shanghai, China / Weather",
},
summ: "85°F",
title:
"Fudan University, 220 Handan Road, Yangpu District, Shanghai, China / Weather",
type: "answerBox",
url: "http://www.zgjia.com/jingdian/yangpu_fudandaxue/15tian.html",
},
],
text: "0.85°F",
},
state: 0,
thought: "我需要使用搜索API来获取上海和天气的信息。",
type: "Search",
url: "http://moss-websearch.cloud:7004/inference",
valid: 0,
},
],
},
];
return (
<>
<div className="chatContainer">
<ChatWebkit.ChatBox
userAvatar={<span>TEST USER</span>}
modelAvatar={<span>LLM</span>}
isPluginCollpaseed={false}
apiType={1}
url=""
propsSessionList={sessionList}
requestMessageContainerStyle={{ backgroundColor: "#ffffff" }}
responseMessageContainerStyle={{
backgroundColor: "rgba(39,45,230,.1)",
}}
/>
</div>
</>
);
}
render(App);