[chore] Reformat new code

5c79c8e1628f898fe953b6df49602e02882c5f44

Cohee <18619528+Cohee1207@users.noreply.github.com>

2 files changed, +8 -8Ignore whitespace
public/scripts/openai.js+5 -5
@@ -2167,15 +2167,15 @@ function getStreamingReply(data, state) {
2167 state.reasoning += (data.choices?.filter(x => x?.delta?.reasoning)?.[0]?.delta?.reasoning || '');2167 state.reasoning += (data.choices?.filter(x => x?.delta?.reasoning)?.[0]?.delta?.reasoning || '');
2168 }2168 }
2169 return data.choices?.[0]?.delta?.content ?? data.choices?.[0]?.message?.content ?? data.choices?.[0]?.text ?? '';2169 return data.choices?.[0]?.delta?.content ?? data.choices?.[0]?.message?.content ?? data.choices?.[0]?.text ?? '';
2170 } else if(oai_settings.chat_completion_source === chat_completion_sources.CUSTOM){2170 } else if (oai_settings.chat_completion_source === chat_completion_sources.CUSTOM) {
2171 if (oai_settings.show_thoughts) {2171 if (oai_settings.show_thoughts) {
2172 state.reasoning +=2172 state.reasoning +=
2173 data.choices?.filter(x => x?.delta?.reasoning_content)?.[0]?.delta?.reasoning_content??2173 data.choices?.filter(x => x?.delta?.reasoning_content)?.[0]?.delta?.reasoning_content ??
2174 data.choices?.filter(x => x?.delta?.reasoning)?.[0]?.delta?.reasoning??2174 data.choices?.filter(x => x?.delta?.reasoning)?.[0]?.delta?.reasoning ??
2175 '';2175 '';
2176 }2176 }
2177 return data.choices?.[0]?.delta?.content ?? data.choices?.[0]?.message?.content ?? data.choices?.[0]?.text ?? '';2177 return data.choices?.[0]?.delta?.content ?? data.choices?.[0]?.message?.content ?? data.choices?.[0]?.text ?? '';
2178 }else{2178 } else {
2179 return data.choices?.[0]?.delta?.content ?? data.choices?.[0]?.message?.content ?? data.choices?.[0]?.text ?? '';2179 return data.choices?.[0]?.delta?.content ?? data.choices?.[0]?.message?.content ?? data.choices?.[0]?.text ?? '';
2180 }2180 }
2181}2181}
public/scripts/reasoning.js+3 -3
@@ -76,10 +76,10 @@ export function extractReasoningFromData(data) {
76 return data?.choices?.[0]?.message?.reasoning ?? '';76 return data?.choices?.[0]?.message?.reasoning ?? '';
77 case chat_completion_sources.MAKERSUITE:77 case chat_completion_sources.MAKERSUITE:
78 return data?.responseContent?.parts?.filter(part => part.thought)?.map(part => part.text)?.join('\n\n') ?? '';78 return data?.responseContent?.parts?.filter(part => part.thought)?.map(part => part.text)?.join('\n\n') ?? '';
79 case chat_completion_sources.CUSTOM:{79 case chat_completion_sources.CUSTOM: {
80 return data?.choices?.[0]?.message?.reasoning_content80 return data?.choices?.[0]?.message?.reasoning_content
81 ?? data?.choices?.[0]?.message?.reasoning81 ?? data?.choices?.[0]?.message?.reasoning
82 ?? '';82 ?? '';
83 }83 }
84 }84 }
85 break;85 break;