feat: Add prompting to guide tool rule usage (#2742)

This commit is contained in:
Matthew Zhou
2025-06-10 16:21:27 -07:00
committed by GitHub
parent e92b83e69e
commit 0399fc8b11
8 changed files with 94 additions and 9 deletions

View File

@@ -1,4 +1,5 @@
import json
import logging
import re
from typing import Dict, List, Optional, Union
@@ -271,6 +272,8 @@ class AnthropicClient(LLMClientBase):
return data
async def count_tokens(self, messages: List[dict] = None, model: str = None, tools: List[OpenAITool] = None) -> int:
logging.getLogger("httpx").setLevel(logging.WARNING)
client = anthropic.AsyncAnthropic()
if messages and len(messages) == 0:
messages = None