Skip to content

Commit 1d83ca3

Browse files
committed
minor #184 [Agent] Add @throws tag (VincentLanglet)
This PR was merged into the main branch. Discussion ---------- [Agent] Add ``@throws`` tag | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | Docs? | yes | Issues | Fix #... | License | MIT Hi `@chr`-hertel, this lib seems to lack of ``@throws`` phpdoc. For static analysis usage (and developer experience) it seems better to tell which methods are throwing exceptions. I didn't look for every methods but started with two important methods imho. Commits ------- ad76d05 Add throws tag
2 parents 18cd546 + ad76d05 commit 1d83ca3

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/agent/src/AgentInterface.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\AI\Agent;
1313

14+
use Symfony\AI\Agent\Exception\ExceptionInterface;
1415
use Symfony\AI\Platform\Message\MessageBagInterface;
1516
use Symfony\AI\Platform\Result\ResultInterface;
1617

@@ -21,6 +22,8 @@ interface AgentInterface
2122
{
2223
/**
2324
* @param array<string, mixed> $options
25+
*
26+
* @throws ExceptionInterface
2427
*/
2528
public function call(MessageBagInterface $messages, array $options = []): ResultInterface;
2629
}

src/agent/src/ChatInterface.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\AI\Agent;
1313

14+
use Symfony\AI\Agent\Exception\ExceptionInterface;
1415
use Symfony\AI\Platform\Message\AssistantMessage;
1516
use Symfony\AI\Platform\Message\MessageBagInterface;
1617
use Symfony\AI\Platform\Message\UserMessage;
@@ -19,5 +20,8 @@ interface ChatInterface
1920
{
2021
public function initiate(MessageBagInterface $messages): void;
2122

23+
/**
24+
* @throws ExceptionInterface
25+
*/
2226
public function submit(UserMessage $message): AssistantMessage;
2327
}

0 commit comments

Comments
 (0)