fix delta is undefined
This commit is contained in:
@@ -115,14 +115,14 @@ export default function ChatBOX(props: {
|
|||||||
const logprob = c?.logprobs?.content[0]?.logprob;
|
const logprob = c?.logprobs?.content[0]?.logprob;
|
||||||
if (logprob !== undefined) {
|
if (logprob !== undefined) {
|
||||||
logprobs.content.push({
|
logprobs.content.push({
|
||||||
token: c.delta.content ?? "",
|
token: c?.delta?.content ?? "",
|
||||||
logprob,
|
logprob,
|
||||||
});
|
});
|
||||||
console.log(c.delta.content, logprob);
|
console.log(c?.delta?.content, logprob);
|
||||||
}
|
}
|
||||||
|
|
||||||
allChunkMessage.push(c.delta.content ?? "");
|
allChunkMessage.push(c?.delta?.content ?? "");
|
||||||
const tool_calls = c.delta.tool_calls;
|
const tool_calls = c?.delta?.tool_calls;
|
||||||
if (tool_calls) {
|
if (tool_calls) {
|
||||||
for (const tool_call of tool_calls) {
|
for (const tool_call of tool_calls) {
|
||||||
// init
|
// init
|
||||||
|
|||||||
Reference in New Issue
Block a user