SimpleChatTC:NonStreaming: Update oneshot mode wrt tool calls
Take care of the possibility of content not being there as well as take care of retrieving the tool calls for further processing. With this tool calls should work in non streaming mode also
This commit is contained in:
parent
3e0cf2a2df
commit
8ca77e455a
|
|
@ -199,7 +199,16 @@ class ChatMessageEx {
|
||||||
*/
|
*/
|
||||||
update_oneshot(nwo, apiEP) {
|
update_oneshot(nwo, apiEP) {
|
||||||
if (apiEP == ApiEP.Type.Chat) {
|
if (apiEP == ApiEP.Type.Chat) {
|
||||||
this.ns.content = nwo["choices"][0]["message"]["content"];
|
let curContent = nwo["choices"][0]["message"]["content"];
|
||||||
|
if (curContent != undefined) {
|
||||||
|
if (curContent != null) {
|
||||||
|
this.ns.content = curContent;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let curTCs = nwo["choices"][0]["message"]["tool_calls"];
|
||||||
|
if (curTCs != undefined) {
|
||||||
|
this.ns.tool_calls = curTCs;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
this.ns.content = nwo["choices"][0]["text"];
|
this.ns.content = nwo["choices"][0]["text"];
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue