refactor: убрать мёртвый API и сентинель-исключение
- удалены неиспользуемые ToolRegistry::all(), FileSandbox::root(), ChatResult::\ (вместе с параметром конструктора) - HttpRequestTool: allowPrivate больше не свойство, только параметр - FileWalker возвращает bool: колбэк возвращает false, чтобы остановить обход; из search_files и find_files убраны throw/catch '__limit__' - добавлены тесты лимита для search_files и find_files - 102 теста
This commit is contained in:
1 parent
27c0fc2477
commit
6734ca5289
9 files changed
+72
-66
No files matched your search
+1
-1
@@ -131,7 +131,6 @@ final class AiClient implements ChatClient
|
||||
toolCalls: self::parseToolCalls($message),
|
||||
assistantMessage: $assistant,
|
||||
usage: is_array($data['usage'] ?? null) ? $data['usage'] : [],
|
||||
raw: $data,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -217,3 +216,4 @@ final class AiClient implements ChatClient
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -16,14 +16,12 @@ final class ChatResult
|
||||
* @param list<array{id: string, name: string, arguments: array<string, mixed>}> $toolCalls
|
||||
* @param array<string, mixed> $assistantMessage
|
||||
* @param array<string, int> $usage
|
||||
* @param array<string, mixed> $raw полный ответ провайдера (для отладки)
|
||||
*/
|
||||
public function __construct(
|
||||
public readonly string $text,
|
||||
public readonly array $toolCalls,
|
||||
public readonly array $assistantMessage,
|
||||
public readonly array $usage = [],
|
||||
public readonly array $raw = [],
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
@@ -33,14 +33,6 @@ final class ToolRegistry
|
||||
return isset($this->tools[$name]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return list<Tool>
|
||||
*/
|
||||
public function all(): array
|
||||
{
|
||||
return array_values($this->tools);
|
||||
}
|
||||
|
||||
/**
|
||||
* Схемы для поля "tools" запроса к модели.
|
||||
*
|
||||
|
||||
Reference in new issue
Block a user