Enable reasoning parsing for Pollinations and AIML
| @@ -2544,7 +2544,7 @@ export function getStreamingReply(data, state, { chatCompletionSource = null, ov | ||
| 2544 | 2544 | state.reasoning += (data.choices?.filter(x => x?.delta?.reasoning)?.[0]?.delta?.reasoning || ''); |
| 2545 | 2545 | } |
| 2546 | 2546 | return data.choices?.[0]?.delta?.content ?? data.choices?.[0]?.message?.content ?? data.choices?.[0]?.text ?? ''; |
| 2547 | 2547 | } else if (chat_completion_source[chat_completion_sources.CUSTOM, ===chat_completion_sources.POLLINATIONS, chat_completion_sources.CUSTOMAIMLAPI].includes(chat_completion_source)) { |
| 2548 | 2548 | if (show_thoughts) { |
| 2549 | 2549 | state.reasoning += |
| 2550 | 2550 | data.choices?.filter(x => x?.delta?.reasoning_content)?.[0]?.delta?.reasoning_content ?? |
| @@ -118,6 +118,8 @@ export function extractReasoningFromData(data, { | ||
| 118 | 118 | return data?.responseContent?.parts?.filter(part => part.thought)?.map(part => part.text)?.join('\n\n') ?? ''; |
| 119 | 119 | case chat_completion_sources.CLAUDE: |
| 120 | 120 | return data?.content?.find(part => part.type === 'thinking')?.thinking ?? ''; |
| 121 | + case chat_completion_sources.AIMLAPI: | |
| 122 | + case chat_completion_sources.POLLINATIONS: | |
| 121 | 123 | case chat_completion_sources.CUSTOM: { |
| 122 | 124 | return data?.choices?.[0]?.message?.reasoning_content |
| 123 | 125 | ?? data?.choices?.[0]?.message?.reasoning |