mirror of
https://github.com/yuruotong1/autoMate.git
synced 2026-03-22 04:57:18 +08:00
优化逻辑
This commit is contained in:
@@ -68,7 +68,7 @@ def run_oai_interleaved(messages: list, system: str, model_name: str, api_key: s
|
||||
# 删除思考和输出标签
|
||||
def delete_think_and_output_tags(content: str, model_name: str):
|
||||
final_answer = content
|
||||
if "r1" in model_name:
|
||||
if ("r1" in model_name) or ("reasoner" in model_name):
|
||||
final_answer = content.split('</think>\n')[-1] if '</think>' in content else content
|
||||
final_answer = final_answer.replace("<output>", "").replace("</output>", "")
|
||||
return final_answer
|
||||
@@ -1,15 +1,12 @@
|
||||
import json
|
||||
from collections.abc import Callable
|
||||
from typing import cast, Callable
|
||||
from typing import Callable
|
||||
import uuid
|
||||
from PIL import Image, ImageDraw
|
||||
import base64
|
||||
from io import BytesIO
|
||||
|
||||
from anthropic import APIResponse
|
||||
from anthropic.types import ToolResultBlockParam
|
||||
from anthropic.types.beta import BetaMessage, BetaTextBlock, BetaToolUseBlock, BetaMessageParam, BetaUsage
|
||||
|
||||
from gradio_ui.agent.llm_utils.oaiclient import run_oai_interleaved
|
||||
from gradio_ui.agent.llm_utils.utils import is_image_path
|
||||
import time
|
||||
|
||||
Reference in New Issue
Block a user