* refactor: LLM response handling with reasoning content - Added a `show_reasoning` parameter to `run_agent` to control the display of reasoning content. - Updated `LLMResponse` to include a `reasoning_content` field for storing reasoning text. - Modified `WebChatMessageEvent` to handle and send reasoning content in streaming responses. - Implemented reasoning extraction in various provider sources (e.g., OpenAI, Gemini). - Updated the chat interface to display reasoning content in a collapsible format. - Removed the deprecated `thinking_filter` package and its associated logic. - Updated localization files to include new reasoning-related strings. * feat: add Groq chat completion provider and associated configurations * Update astrbot/core/provider/sources/gemini_source.py Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com> --------- Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
54 lines
1.4 KiB
Python
54 lines
1.4 KiB
Python
from astrbot.core.config.astrbot_config import AstrBotConfig
|
||
from astrbot import logger
|
||
from astrbot.core import html_renderer
|
||
from astrbot.core.star.register import register_llm_tool as llm_tool
|
||
|
||
# event
|
||
from astrbot.core.message.message_event_result import (
|
||
MessageEventResult,
|
||
MessageChain,
|
||
CommandResult,
|
||
EventResultType,
|
||
)
|
||
from astrbot.core.platform import AstrMessageEvent
|
||
|
||
# star register
|
||
from astrbot.core.star.register import (
|
||
register_command as command,
|
||
register_command_group as command_group,
|
||
register_event_message_type as event_message_type,
|
||
register_regex as regex,
|
||
register_platform_adapter_type as platform_adapter_type,
|
||
)
|
||
from astrbot.core.star.filter.event_message_type import (
|
||
EventMessageTypeFilter,
|
||
EventMessageType,
|
||
)
|
||
from astrbot.core.star.filter.platform_adapter_type import (
|
||
PlatformAdapterTypeFilter,
|
||
PlatformAdapterType,
|
||
)
|
||
from astrbot.core.star.register import (
|
||
register_star as register, # 注册插件(Star)
|
||
)
|
||
from astrbot.core.star import Context, Star
|
||
from astrbot.core.star.config import *
|
||
|
||
|
||
# provider
|
||
from astrbot.core.provider import Provider, ProviderMetaData
|
||
from astrbot.core.db.po import Personality
|
||
|
||
# platform
|
||
from astrbot.core.platform import (
|
||
AstrMessageEvent,
|
||
Platform,
|
||
AstrBotMessage,
|
||
MessageMember,
|
||
MessageType,
|
||
PlatformMetadata,
|
||
)
|
||
|
||
from astrbot.core.platform.register import register_platform_adapter
|
||
|
||
from .message_components import * |