From b2ba6e7ed6de2eb89a870174cfcf226985738a76 Mon Sep 17 00:00:00 2001 From: use-the-fork Date: Wed, 23 Oct 2024 21:38:11 -0400 Subject: [PATCH] =?UTF-8?q?chore(tests):=20remove=20obsolete=20RatAgentCha?= =?UTF-8?q?in=20fixture=20files=20=F0=9F=97=91=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Deleted multiple obsolete fixture files under `tests/Fixtures/Saloon/AgentChains/`. - Cleaned up unnecessary test data and improved project organization. --- docs/tools/index.md | 9 +-- docs/tools/packaged-tools.md | 7 +- .../Prompts/Rat/GetQueryPrompt.blade.php | 13 +++- .../Prompts/Rat/ReflectAnswerPrompt.blade.php | 16 ++++ .../Prompts/Rat/ReviseAnswerPrompt.blade.php | 25 ++++++ src/AgentChain.php | 58 +------------- src/AgentChains/RatAgentChain.php | 78 +++++++++++++++++++ src/Agents/Rat/ReflectAnswerAgent.php | 27 +++++++ src/Agents/Rat/ReviseAnswerAgent.php | 27 +++++++ src/Contracts/Tool/SearchTool.php | 7 +- src/Tools/Search/SerpAPIGoogleNewsTool.php | 12 +-- src/Tools/Search/SerpAPIGoogleSearchTool.php | 11 +-- src/Tools/Search/SerperTool.php | 31 ++++---- tests/AgentChains/RatAgentChainTest.php | 42 +++++----- ...hain-1490b8772b2bf708d3727e1fd1e12414.json | 10 +++ ...hain-2a0fcbb75e327652be2126fa648bd3e7.json | 10 +++ ...hain-47261d97210e865ca4818128f63d6926.json | 10 +++ ...hain-475d90e301668292a051dde550aee5a3.json | 11 +++ ...hain-72d3babdd785f7230e988f2e032f473d.json | 10 +++ ...hain-bc0c986806c46d9aa119053ac316b3ce.json | 10 +++ ...hain-d5c8e692581754f3aac57899f4c2603f.json | 10 +++ ...hain-ebe56fdb70a6f5dc2640a5e4b73366bc.json | 10 +++ ...hain-f709b10afe10f8e52425993b58e251a0.json | 10 +++ ...hain-ff5f3fc0f8a597f498ab55b7f934f5f1.json | 10 +++ ...Tool-073fd35020257fc589393e63f7775273.json | 8 ++ ...Tool-7b2933b3fa7351d076f3f06764a92c50.json | 8 ++ ...Tool-a08c0ae23dd3be2864787728bf4e74c4.json | 8 ++ ...Tool-566ab17bb6275aec1c9b3987dfebd126.json | 9 +++ ...Tool-6569dc605a724876f77e71cee5a3192d.json | 8 ++ ...Tool-c94f9a735104da2fd9c0c44ea1ed1ba1.json | 8 ++ ...Tool-d4bf31054d2e78fbc5e45673b16c9a89.json | 8 ++ ...hain-0dac52efdcd81f0dae4be83cc7dd9134.json | 10 --- ...hain-23b86031e4743be2f58c64dd85d11f40.json | 31 -------- ...hain-3a4abc7b397c195a952d147f5999c932.json | 31 -------- ...hain-3d6768be2549ac5e1a0e44d2ed1eb2c1.json | 31 -------- ...hain-7e62e7ca508c58a7dd52e9451a68d9b2.json | 31 -------- ...hain-9ce86b41e54066cf052469d1d46c848d.json | 10 --- ...hain-c8b871f5b66ceee6cdd6a4f41ca4809e.json | 10 --- ...hain-e6be3b2a969ae75116175e3c039cc2f2.json | 11 --- ...gent-9ae29f2ff260a200c78e895234990b88.json | 10 +++ ...gent-c31fbf2a429a96687e99c3b94fd406f3.json | 9 +++ ...gent-dd3c1226bcfb52db4cac0fc3cd00f4f0.json | 9 +++ ...gent-75c161b01e340522e8715d4c26443fa9.json | 10 +++ ...gent-f7bf86866f50c4d6aa1c3352ff0b6f8c.json | 10 +++ tests/Integrations/ClaudeIntegrationTest.php | 36 ++++----- tests/Integrations/OllamaIntegrationTest.php | 32 ++++---- tests/Integrations/OpenAiIntegrationTest.php | 34 ++++---- 47 files changed, 488 insertions(+), 348 deletions(-) create mode 100644 resources/views/Prompts/Rat/ReflectAnswerPrompt.blade.php create mode 100644 resources/views/Prompts/Rat/ReviseAnswerPrompt.blade.php create mode 100644 src/AgentChains/RatAgentChain.php create mode 100644 src/Agents/Rat/ReflectAnswerAgent.php create mode 100644 src/Agents/Rat/ReviseAnswerAgent.php create mode 100644 tests/Fixtures/Saloon/AgentChains/Rat/RatAgentChain-1490b8772b2bf708d3727e1fd1e12414.json create mode 100644 tests/Fixtures/Saloon/AgentChains/Rat/RatAgentChain-2a0fcbb75e327652be2126fa648bd3e7.json create mode 100644 tests/Fixtures/Saloon/AgentChains/Rat/RatAgentChain-47261d97210e865ca4818128f63d6926.json create mode 100644 tests/Fixtures/Saloon/AgentChains/Rat/RatAgentChain-475d90e301668292a051dde550aee5a3.json create mode 100644 tests/Fixtures/Saloon/AgentChains/Rat/RatAgentChain-72d3babdd785f7230e988f2e032f473d.json create mode 100644 tests/Fixtures/Saloon/AgentChains/Rat/RatAgentChain-bc0c986806c46d9aa119053ac316b3ce.json create mode 100644 tests/Fixtures/Saloon/AgentChains/Rat/RatAgentChain-d5c8e692581754f3aac57899f4c2603f.json create mode 100644 tests/Fixtures/Saloon/AgentChains/Rat/RatAgentChain-ebe56fdb70a6f5dc2640a5e4b73366bc.json create mode 100644 tests/Fixtures/Saloon/AgentChains/Rat/RatAgentChain-f709b10afe10f8e52425993b58e251a0.json create mode 100644 tests/Fixtures/Saloon/AgentChains/Rat/RatAgentChain-ff5f3fc0f8a597f498ab55b7f934f5f1.json create mode 100644 tests/Fixtures/Saloon/AgentChains/Rat/RatAgentChainFirecrawlTool-073fd35020257fc589393e63f7775273.json create mode 100644 tests/Fixtures/Saloon/AgentChains/Rat/RatAgentChainFirecrawlTool-7b2933b3fa7351d076f3f06764a92c50.json create mode 100644 tests/Fixtures/Saloon/AgentChains/Rat/RatAgentChainFirecrawlTool-a08c0ae23dd3be2864787728bf4e74c4.json create mode 100644 tests/Fixtures/Saloon/AgentChains/Rat/RatAgentChainSerperTool-566ab17bb6275aec1c9b3987dfebd126.json create mode 100644 tests/Fixtures/Saloon/AgentChains/Rat/RatAgentChainSerperTool-6569dc605a724876f77e71cee5a3192d.json create mode 100644 tests/Fixtures/Saloon/AgentChains/Rat/RatAgentChainSerperTool-c94f9a735104da2fd9c0c44ea1ed1ba1.json create mode 100644 tests/Fixtures/Saloon/AgentChains/Rat/RatAgentChainSerperTool-d4bf31054d2e78fbc5e45673b16c9a89.json delete mode 100644 tests/Fixtures/Saloon/AgentChains/RatAgentChain-0dac52efdcd81f0dae4be83cc7dd9134.json delete mode 100644 tests/Fixtures/Saloon/AgentChains/RatAgentChain-23b86031e4743be2f58c64dd85d11f40.json delete mode 100644 tests/Fixtures/Saloon/AgentChains/RatAgentChain-3a4abc7b397c195a952d147f5999c932.json delete mode 100644 tests/Fixtures/Saloon/AgentChains/RatAgentChain-3d6768be2549ac5e1a0e44d2ed1eb2c1.json delete mode 100644 tests/Fixtures/Saloon/AgentChains/RatAgentChain-7e62e7ca508c58a7dd52e9451a68d9b2.json delete mode 100644 tests/Fixtures/Saloon/AgentChains/RatAgentChain-9ce86b41e54066cf052469d1d46c848d.json delete mode 100644 tests/Fixtures/Saloon/AgentChains/RatAgentChain-c8b871f5b66ceee6cdd6a4f41ca4809e.json delete mode 100644 tests/Fixtures/Saloon/AgentChains/RatAgentChain-e6be3b2a969ae75116175e3c039cc2f2.json create mode 100644 tests/Fixtures/Saloon/Integrations/ClaudeToolTestAgent-9ae29f2ff260a200c78e895234990b88.json create mode 100644 tests/Fixtures/Saloon/Integrations/ClaudeToolTestAgent-c31fbf2a429a96687e99c3b94fd406f3.json create mode 100644 tests/Fixtures/Saloon/Integrations/OllamaToolTestAgent-dd3c1226bcfb52db4cac0fc3cd00f4f0.json create mode 100644 tests/Fixtures/Saloon/Integrations/OpenAiToolTestAgent-75c161b01e340522e8715d4c26443fa9.json create mode 100644 tests/Fixtures/Saloon/Tools/SerperTestAgent-f7bf86866f50c4d6aa1c3352ff0b6f8c.json diff --git a/docs/tools/index.md b/docs/tools/index.md index 06c6dbc..5aeba67 100644 --- a/docs/tools/index.md +++ b/docs/tools/index.md @@ -5,14 +5,7 @@ Tools allow your agent to interact with your application or external APIs. Essen Tools are inherently part of all agents, but they are not invoked unless the `resolveTools` method returns an array of tools that the agent can use. Below is an example where the `SerperTool` is added to an agent, allowing it to perform Google searches. ```php -use UseTheFork\Synapse\Agent; -use UseTheFork\Synapse\Contracts\Agent\HasOutputSchema; -use UseTheFork\Synapse\Contracts\Integration; -use UseTheFork\Synapse\Contracts\Tool; -use UseTheFork\Synapse\Integrations\OpenAIIntegration; -use UseTheFork\Synapse\Tools\SerperTool; -use UseTheFork\Synapse\Traits\Agent\ValidatesOutputSchema; -use UseTheFork\Synapse\ValueObject\SchemaRule; +use UseTheFork\Synapse\Agent;use UseTheFork\Synapse\Contracts\Agent\HasOutputSchema;use UseTheFork\Synapse\Contracts\Integration;use UseTheFork\Synapse\Integrations\OpenAIIntegration;use UseTheFork\Synapse\Tools\Search\SerperTool;use UseTheFork\Synapse\Traits\Agent\ValidatesOutputSchema;use UseTheFork\Synapse\ValueObject\SchemaRule; class SerperAgent extends Agent implements HasOutputSchema { diff --git a/docs/tools/packaged-tools.md b/docs/tools/packaged-tools.md index 7ca6886..b5fc649 100644 --- a/docs/tools/packaged-tools.md +++ b/docs/tools/packaged-tools.md @@ -16,7 +16,7 @@ SERPER_API_KEY= Then, include the `SerperTool` in your agent: ```php -use UseTheFork\Synapse\Tools\SerperTool; +use UseTheFork\Synapse\Tools\Search\SerperTool; protected function resolveTools(): array { @@ -38,8 +38,7 @@ SERPAPI_API_KEY= Then, include either the `SerpAPIGoogleSearchTool` or the `SerpAPIGoogleNewsTool` in your agent: ```php -use UseTheFork\Synapse\Tools\SerpAPIGoogleNewsTool; -use UseTheFork\Synapse\Tools\SerpAPIGoogleSearchTool; +use UseTheFork\Synapse\Tools\Search\SerpAPIGoogleNewsTool;use UseTheFork\Synapse\Tools\Search\SerpAPIGoogleSearchTool; protected function resolveTools(): array { @@ -64,7 +63,7 @@ FIRECRAWL_API_KEY= Then, include the `FirecrawlTool` in your agent: ```php -use UseTheFork\Synapse\Tools\FirecrawlTool; +use UseTheFork\Synapse\Tools\Scrape\FirecrawlTool; protected function resolveTools(): array { diff --git a/resources/views/Prompts/Rat/GetQueryPrompt.blade.php b/resources/views/Prompts/Rat/GetQueryPrompt.blade.php index 4e19d4d..61b8970 100644 --- a/resources/views/Prompts/Rat/GetQueryPrompt.blade.php +++ b/resources/views/Prompts/Rat/GetQueryPrompt.blade.php @@ -1,11 +1,16 @@ -## User input: {{ $question }} +### Question: {{ $question }} -## Response +### Content {{ $answer }} -## Instruction -Summarize the content with a focus on the last sentences to create a concise search query for Bing. Use search syntax to make the query specific and relevant for content verification. +### Instruction +I want to verify the content correctness of the given question, especially the last sentences. +Please summarize the content with the corresponding question. +This summarization will be used as a query to search with Bing search engine. +The query should be short but need to be specific to promise Bing can find related knowledge or pages. +You can also use search syntax to make the query short and clear enough for the search engine to find relevant language data. +Try to make the query as relevant as possible to the last few sentences in the content. @include('synapse::Parts.OutputSchema') diff --git a/resources/views/Prompts/Rat/ReflectAnswerPrompt.blade.php b/resources/views/Prompts/Rat/ReflectAnswerPrompt.blade.php new file mode 100644 index 0000000..281c321 --- /dev/null +++ b/resources/views/Prompts/Rat/ReflectAnswerPrompt.blade.php @@ -0,0 +1,16 @@ + + ### Question: {{ $question }} + + ### Answer: + {{ $answer }} + + ### Instruction + Give a title for the answer of the question. + And add a subtitle to each paragraph in the answer and output the final answer using markdown format. + This will make the answer to this question look more structured for better understanding. + + **IMPORTANT** + Try to keep the structure (multiple paragraphs with its subtitles) in the response and make it more structural for understanding. + + @include('synapse::Parts.OutputSchema') + diff --git a/resources/views/Prompts/Rat/ReviseAnswerPrompt.blade.php b/resources/views/Prompts/Rat/ReviseAnswerPrompt.blade.php new file mode 100644 index 0000000..c6253b6 --- /dev/null +++ b/resources/views/Prompts/Rat/ReviseAnswerPrompt.blade.php @@ -0,0 +1,25 @@ + + ### Existing Text in Wiki Web: + ``` + {{ $content }} + ``` + + ### Question: {{ $question }} + + ### Answer: + {{ $answer }} + + ### Instruction + I want to revise the answer according to retrieved related text of the question in WIKI pages. + You need to check whether the answer is correct. + If you find some errors in the answer, revise the answer to make it better. + If you find some necessary details are ignored, add it to make the answer more plausible according to the related text. + If you find the answer is right and do not need to add more details, just output the original answer directly. + + **IMPORTANT** + Try to keep the structure (multiple paragraphs with its subtitles) in the revised answer and make it more structural for understanding. + Add more details from retrieved text to the answer. + Split the paragraphs with \n\n characters. + + @include('synapse::Parts.OutputSchema') + diff --git a/src/AgentChain.php b/src/AgentChain.php index d08a373..785daf7 100644 --- a/src/AgentChain.php +++ b/src/AgentChain.php @@ -4,40 +4,10 @@ namespace UseTheFork\Synapse; - use UseTheFork\Synapse\AgentTask\PendingAgentChain; - use UseTheFork\Synapse\Traits\HasConfig; - use UseTheFork\Synapse\Traits\Makeable; use UseTheFork\Synapse\ValueObject\Message; - class AgentChain + abstract class AgentChain { - use Makeable; - use HasConfig; - - protected PendingAgentChain $pendingAgentChain; - protected $pipeline; - - public function __construct(array $agents) - { - foreach ($agents as $agent) { - if(! ($agent instanceof Agent)){ - throw new \Exception("Agent must be an instance of Agent"); - } - } - - $this->config()->add('persistInputs', []); - $this->config()->add('agents', collect($agents)); - $this->pendingAgentChain = $this->createPendingAgentChain(); - - } - - /** - * Create a new PendingAgentTask - */ - public function createPendingAgentChain(): PendingAgentChain - { - return new PendingAgentChain($this); - } /** * Handles the user input and extra agent arguments to retrieve the response. @@ -48,29 +18,5 @@ public function createPendingAgentChain(): PendingAgentChain * * @throws Throwable */ - public function handle(?array $input): Message - { - $this->config()->add('input', $input); - $this->config()->get('agents')->each(function ($agent) use ($input) { - $input = [ - ...$this->config()->get('input'), - ...$this->config()->get('persistInputs') - ]; - $response = $agent->handle($input); - $this->config()->add('input', $response->content()); - }); - - return Message::make([ - 'role' => 'agent', - 'finish_reason' => 'stop', - 'content' => $this->config()->get('input') - ]); - } - - public function persistInputs(array $inputs): static - { - $this->config()->add('persistInputs', $inputs); - - return $this; - } + abstract public function handle(?array $input, ?array $extraAgentArgs): Message; } diff --git a/src/AgentChains/RatAgentChain.php b/src/AgentChains/RatAgentChain.php new file mode 100644 index 0000000..88436ec --- /dev/null +++ b/src/AgentChains/RatAgentChain.php @@ -0,0 +1,78 @@ +searchTool = $searchTool; + $this->scrapeTool = $scrapeTool; + } + + public function handle(?array $input, ?array $extraAgentArgs = []): Message + { + + $ratDraftAgent = new RatDraftAgent; + $result = $ratDraftAgent->handle($input); + + $ratSplitAnswerAgent = new RatSplitAnswerAgent; + $result = $ratSplitAnswerAgent->handle([ + ...$input, + ...$result->content() + ]); + + $answer = str(''); + foreach ($result->content()['paragraphs'] as $value) { + + $answer = $answer->append("\n\n", $value); + + $getQueryAgent = new GetQueryAgent; + $result = $getQueryAgent->handle([ + ...$input, + 'answer' => $answer->toString() + ]); + + $searchResult = $this->searchTool->handle($result->content()['query']); + $searchResult = json_decode($searchResult, true); + + # Get the first Result scrape page and enhance + if(!empty($searchResult[0])){ + $scrapeResult = $this->scrapeTool->handle($searchResult[0]['link']); + + $getQueryAgent = new ReviseAnswerAgent; + $result = $getQueryAgent->handle([ + ...$input, + 'content' => $scrapeResult, + 'answer' => $answer->toString() + ]); + $answer = str($result->content()['answer']); + } + + } + + $reflectAnswerAgent = new ReflectAnswerAgent; + return $reflectAnswerAgent->handle([ + ...$input, + 'answer' => $answer->toString() + ]); + } + } diff --git a/src/Agents/Rat/ReflectAnswerAgent.php b/src/Agents/Rat/ReflectAnswerAgent.php new file mode 100644 index 0000000..d38f6a1 --- /dev/null +++ b/src/Agents/Rat/ReflectAnswerAgent.php @@ -0,0 +1,27 @@ + 'answer', + 'rules' => 'required|string', + 'description' => 'Your answer.', + ]), + ]; + } +} diff --git a/src/Agents/Rat/ReviseAnswerAgent.php b/src/Agents/Rat/ReviseAnswerAgent.php new file mode 100644 index 0000000..72e4b61 --- /dev/null +++ b/src/Agents/Rat/ReviseAnswerAgent.php @@ -0,0 +1,27 @@ + 'answer', + 'rules' => 'required|string', + 'description' => 'Your answer.', + ]), + ]; + } +} diff --git a/src/Contracts/Tool/SearchTool.php b/src/Contracts/Tool/SearchTool.php index 5a1a520..3969bce 100644 --- a/src/Contracts/Tool/SearchTool.php +++ b/src/Contracts/Tool/SearchTool.php @@ -4,14 +4,11 @@ namespace UseTheFork\Synapse\Contracts\Tool; -use UseTheFork\Synapse\Enums\ReturnType; - interface SearchTool { public function handle( string $query, ?string $searchType = 'search', - ?int $numberOfResults = 10, - ReturnType $returnType = ReturnType::STRING, - ): string|array; + ?int $numberOfResults = 10 + ): string; } diff --git a/src/Tools/Search/SerpAPIGoogleNewsTool.php b/src/Tools/Search/SerpAPIGoogleNewsTool.php index ff19c91..6370ab4 100644 --- a/src/Tools/Search/SerpAPIGoogleNewsTool.php +++ b/src/Tools/Search/SerpAPIGoogleNewsTool.php @@ -7,7 +7,6 @@ use Illuminate\Support\Arr; use UseTheFork\Synapse\Contracts\Tool; use UseTheFork\Synapse\Contracts\Tool\SearchTool; -use UseTheFork\Synapse\Enums\ReturnType; use UseTheFork\Synapse\Exceptions\MissingApiKeyException; use UseTheFork\Synapse\Services\SerpApi\Requests\SerpApiSearchRequest; use UseTheFork\Synapse\Services\SerpApi\SerpApiConnector; @@ -34,19 +33,14 @@ public function __construct() public function handle( string $query, ?string $searchType = 'search', - ?int $numberOfResults = 10, - ?ReturnType $returnType = ReturnType::STRING, - ): string|array { + ?int $numberOfResults = 10 + ): string { $serpApiConnector = new SerpApiConnector($this->apiKey); $serpApiSearchRequest = new SerpApiSearchRequest($query, 0, 'google_news'); $results = $serpApiConnector->send($serpApiSearchRequest)->array(); - - return match ($returnType) { - ReturnType::STRING => $this->parseResults($results), - default => $results - }; + return $this->parseResults($results); } private function parseResults(array $results): string diff --git a/src/Tools/Search/SerpAPIGoogleSearchTool.php b/src/Tools/Search/SerpAPIGoogleSearchTool.php index 86d5e6f..b4e4ece 100644 --- a/src/Tools/Search/SerpAPIGoogleSearchTool.php +++ b/src/Tools/Search/SerpAPIGoogleSearchTool.php @@ -8,7 +8,6 @@ use Illuminate\Support\Str; use UseTheFork\Synapse\Contracts\Tool; use UseTheFork\Synapse\Contracts\Tool\SearchTool; -use UseTheFork\Synapse\Enums\ReturnType; use UseTheFork\Synapse\Exceptions\MissingApiKeyException; use UseTheFork\Synapse\Services\SerpApi\Requests\SerpApiSearchRequest; use UseTheFork\Synapse\Services\SerpApi\SerpApiConnector; @@ -36,19 +35,15 @@ public function __construct() public function handle( string $query, ?string $searchType = 'search', - ?int $numberOfResults = 10, - ReturnType $returnType = ReturnType::STRING, - ): string|array { + ?int $numberOfResults = 10 + ): string { $serpApiConnector = new SerpApiConnector($this->apiKey); $serpApiSearchRequest = new SerpApiSearchRequest($query, $numberOfResults); $results = $serpApiConnector->send($serpApiSearchRequest)->array(); - return match ($returnType) { - ReturnType::STRING => $this->parseResults($results), - default => $results - }; + return $this->parseResults($results); } private function parseResults(array $results): string diff --git a/src/Tools/Search/SerperTool.php b/src/Tools/Search/SerperTool.php index 8c0999d..4e374ea 100644 --- a/src/Tools/Search/SerperTool.php +++ b/src/Tools/Search/SerperTool.php @@ -8,7 +8,6 @@ use Saloon\Exceptions\Request\FatalRequestException; use Saloon\Exceptions\Request\RequestException; use UseTheFork\Synapse\Contracts\Tool\SearchTool; -use UseTheFork\Synapse\Enums\ReturnType; use UseTheFork\Synapse\Exceptions\MissingApiKeyException; use UseTheFork\Synapse\Services\Serper\Requests\SerperSearchRequest; use UseTheFork\Synapse\Services\Serper\SerperConnector; @@ -22,7 +21,7 @@ public function __construct() { $this->apiKey = config('synapse.services.serper.key'); - if(empty($this->apiKey)) { + if (empty($this->apiKey)) { throw new MissingApiKeyException('API (SERPER_API_KEY) key is required.'); } } @@ -30,29 +29,24 @@ public function __construct() /** * Search Google using a query. * - * @param string $query the search query to execute. - * @param string $searchType the type of search must be one of `search`, `places`, `news`. (usually search). - * @param int $numberOfResults the number of results to return must be one of `10`, `20`, `30`, `40`, `50` (usually `10`). + * @param string $query the search query to execute. + * @param string|null $searchType the type of search must be one of `search`, `places`, `news`. (usually search). + * @param int|null $numberOfResults the number of results to return must be one of `10`, `20`, `30`, `40`, `50` (usually `10`). * - * @return string * @throws FatalRequestException * @throws RequestException */ public function handle( string $query, ?string $searchType = 'search', - ?int $numberOfResults = 10, - ReturnType $returnType = ReturnType::STRING, - ): string|array { + ?int $numberOfResults = 10 + ): string { $serperConnector = new SerperConnector($this->apiKey); $serperSearchRequest = new SerperSearchRequest($query, $searchType, $numberOfResults); $results = $serperConnector->send($serperSearchRequest)->array(); - return match ($returnType) { - ReturnType::STRING => $this->parseResults($results), - default => $results - }; + return $this->parseResults($results); } private function parseResults(array $results): string @@ -63,28 +57,29 @@ private function parseResults(array $results): string $title = Arr::get($results, 'knowledgeGraph.title'); $entityType = Arr::get($results, 'knowledgeGraph.type'); if ($entityType) { - $snippets->push("{$title}: {$entityType}"); + $snippets->push(['type' => 'Knowledge Graph title', "{$title}" => "{$entityType}"]); } $description = Arr::get($results, 'knowledgeGraph.description'); if ($description) { $snippets->push($description); + $snippets->push(['type' => 'Knowledge Graph Description', 'value' => $description]); } foreach (Arr::get($results, 'knowledgeGraph.attributes', []) as $key => $value) { - $snippets->push("{$title} {$key}: {$value}"); + $snippets->push(['type' => 'Knowledge Graph Attribute', 'title' => $title, 'key' => $key, 'value' => $value]); } } if (! empty($results['organic'])) { foreach ($results['organic'] as $value) { - $snippets->push("```text\nTitle: {$value['title']}\nLink: {$value['link']}\nSnippet: {$value['snippet']}\n```"); + $snippets->push(['type' => 'Organic', 'title' => $value['title'], 'link' => $value['link'], 'snippet' => $value['snippet']]); } } if ($snippets->isEmpty()) { - return 'No good Google Search Result was found'; + return json_encode(['title' => 'No Good Google Search Result was found', 'snippet' => '', 'link' => ''], JSON_PRETTY_PRINT); } - return $snippets->implode("\n"); + return json_encode($snippets, JSON_PRETTY_PRINT); } } diff --git a/tests/AgentChains/RatAgentChainTest.php b/tests/AgentChains/RatAgentChainTest.php index 1007064..191c149 100644 --- a/tests/AgentChains/RatAgentChainTest.php +++ b/tests/AgentChains/RatAgentChainTest.php @@ -2,42 +2,44 @@ declare(strict_types=1); +use Saloon\Http\Faking\Fixture; use Saloon\Http\Faking\MockClient; use Saloon\Http\Faking\MockResponse; use Saloon\Http\PendingRequest; -use UseTheFork\Synapse\AgentChain; -use UseTheFork\Synapse\Agents\Rat\RatDraftAgent; -use UseTheFork\Synapse\Agents\Rat\RatSplitAnswerAgent; +use UseTheFork\Synapse\AgentChains\RatAgentChain; use UseTheFork\Synapse\Integrations\Connectors\OpenAI\Requests\ChatRequest; +use UseTheFork\Synapse\Services\Firecrawl\Requests\FirecrawlRequest; +use UseTheFork\Synapse\Services\Serper\Requests\SerperSearchRequest; +use UseTheFork\Synapse\Tools\Scrape\FirecrawlTool; +use UseTheFork\Synapse\Tools\Search\SerperTool; it('executes a RAT chain', function (): void { MockClient::global([ - ChatRequest::class => function (PendingRequest $pendingRequest): \Saloon\Http\Faking\Fixture { + ChatRequest::class => function (PendingRequest $pendingRequest): Fixture { $hash = md5(json_encode($pendingRequest->body()->get('messages'))); - return MockResponse::fixture("AgentChains/RatAgentChain-{$hash}"); + return MockResponse::fixture("AgentChains/Rat/RatAgentChain-{$hash}"); }, - ]); + SerperSearchRequest::class => function (PendingRequest $pendingRequest): Fixture { + + $hash = md5(json_encode($pendingRequest->body()->all())); + + return MockResponse::fixture("AgentChains/Rat/RatAgentChainSerperTool-{$hash}"); + }, + FirecrawlRequest::class => function (PendingRequest $pendingRequest): Fixture { + $hash = md5(json_encode($pendingRequest->body()->all())); - $agentChain = AgentChain::make([ - new RatDraftAgent, - new RatSplitAnswerAgent, - ])->persistInputs([ - 'question' => 'how so I improve my heart health?', - 'number_of_paragraphs' => '5', + return MockResponse::fixture("AgentChains/Rat/RatAgentChainFirecrawlTool-{$hash}"); + }, ]); - $message = $agentChain->handle([]); + $ratAgentChain = new RatAgentChain(new SerperTool, new FirecrawlTool); + $message = $ratAgentChain->handle(['question' => 'Summarize the American Civil War according to the timeline.', 'number_of_paragraphs' => '5']); $agentResponseArray = $message->toArray(); expect($agentResponseArray['content'])->toBeArray() - ->and($agentResponseArray['content'])->toHaveKey('paragraphs') - ->and($agentResponseArray['content']['paragraphs'])->toBeArray(); - - $answer = ''; - foreach ($agentResponseArray['content']['paragraphs'] as $paragraph) { - $answer = "{$answer}\n\n{$paragraph}"; - } + ->and($agentResponseArray['content'])->toHaveKey('answer') + ->and($agentResponseArray['content']['answer'])->toContain('The American Civil War, which spanned from 1861 to 1865, '); }); diff --git a/tests/Fixtures/Saloon/AgentChains/Rat/RatAgentChain-1490b8772b2bf708d3727e1fd1e12414.json b/tests/Fixtures/Saloon/AgentChains/Rat/RatAgentChain-1490b8772b2bf708d3727e1fd1e12414.json new file mode 100644 index 0000000..bee3a0f --- /dev/null +++ b/tests/Fixtures/Saloon/AgentChains/Rat/RatAgentChain-1490b8772b2bf708d3727e1fd1e12414.json @@ -0,0 +1,10 @@ +{ + "statusCode": 200, + "headers": { + "Date": "Tue, 22 Oct 2024 23:58:48 GMT", + "Content-Type": "application\/json", + "Transfer-Encoding": "chunked", + "Connection": "keep-alive" + }, + "data": "{\n \"id\": \"chatcmpl-ALJ3lAka26S9EVMFchmwL6ox7ddvT\",\n \"object\": \"chat.completion\",\n \"created\": 1729641517,\n \"model\": \"gpt-4-turbo-2024-04-09\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"{\\n \\\"paragraphs\\\": [\\n \\\"The American Civil War, fought from 1861 to 1865, was a pivotal conflict in United States history, primarily about states' rights and slavery. The war began after several Southern states seceded from the Union, forming the Confederate States of America in response to the election of Abraham Lincoln in 1860 and the growing tensions related to slavery. In 1861, the conflict officially commenced with the Confederate attack on Fort Sumter in South Carolina on April 12th. This led President Lincoln to call for 75,000 volunteers, sparking additional Southern states to secede. The key early battles included Bull Run and the Battle of Shiloh, indicating that the war would be longer and more brutal than initially anticipated.\\\",\\n \\\"By 1862, the war had expanded across multiple fronts. Key events include the introduction of the Emancipation Proclamation by President Lincoln, which declared all slaves in Confederate states to be free, turning the conflict more distinctly into a war about slavery as well as state rights. Major battles like Antietam, which remains one of the deadliest single-day battles in American history, further underscored the ferocity of the conflict.\\\",\\n \\\"The year 1863 is marked significantly by the Battle of Gettysburg and the Siege of Vicksburg. These were pivotal Union victories that significantly turned the tide of the war. The Gettysburg Address, delivered by Lincoln in November, redefined the purpose of the war and is one of the most famous speeches in American history.\\\",\\n \\\"In 1864-65, General Ulysses S. Grant led the Union forces in a series of battles that gradually crushed the Confederate resistance. Sherman's March to the Sea further devastated the South's infrastructure and economy. The war concluded with the surrender of Confederate General Robert E. Lee to Grant at Appomattox Court House on April 9, 1865. The aftermath of the war involved Reconstruction, a period of rebuilding and integrating the Southern states back into the Union, marked by significant social, economic, and legislative changes.\\\"\\n ]\\n}\",\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 568,\n \"completion_tokens\": 432,\n \"total_tokens\": 1000,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0\n }\n },\n \"system_fingerprint\": \"fp_eae715ec6a\"\n}\n" +} diff --git a/tests/Fixtures/Saloon/AgentChains/Rat/RatAgentChain-2a0fcbb75e327652be2126fa648bd3e7.json b/tests/Fixtures/Saloon/AgentChains/Rat/RatAgentChain-2a0fcbb75e327652be2126fa648bd3e7.json new file mode 100644 index 0000000..a5ef213 --- /dev/null +++ b/tests/Fixtures/Saloon/AgentChains/Rat/RatAgentChain-2a0fcbb75e327652be2126fa648bd3e7.json @@ -0,0 +1,10 @@ +{ + "statusCode": 200, + "headers": { + "Date": "Tue, 22 Oct 2024 23:58:53 GMT", + "Content-Type": "application/json", + "Content-Length": "738", + "Connection": "keep-alive" + }, + "data": "{\n \"id\": \"chatcmpl-ALJ40egt1p5rATI4JoqpMLM7PBxaw\",\n \"object\": \"chat.completion\",\n \"created\": 1729641532,\n \"model\": \"gpt-4-turbo-2024-04-09\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"{\\n \\\"query\\\": \\\"American Civil War 1862 key events Emancipation Proclamation and Battle of Antietam\\\"\\n}\\n```\",\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 439,\n \"completion_tokens\": 28,\n \"total_tokens\": 467,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0\n }\n },\n \"system_fingerprint\": \"fp_eae715ec6a\"\n}\n" +} diff --git a/tests/Fixtures/Saloon/AgentChains/Rat/RatAgentChain-47261d97210e865ca4818128f63d6926.json b/tests/Fixtures/Saloon/AgentChains/Rat/RatAgentChain-47261d97210e865ca4818128f63d6926.json new file mode 100644 index 0000000..f379967 --- /dev/null +++ b/tests/Fixtures/Saloon/AgentChains/Rat/RatAgentChain-47261d97210e865ca4818128f63d6926.json @@ -0,0 +1,10 @@ +{ + "statusCode": 200, + "headers": { + "Date": "Tue, 22 Oct 2024 23:59:24 GMT", + "Content-Type": "application\/json", + "Content-Length": "1745", + "Connection": "keep-alive" + }, + "data": "{\n \"id\": \"chatcmpl-ALJ4Q6NNevk8phJKhiE4vUNHF8sIj\",\n \"object\": \"chat.completion\",\n \"created\": 1729641558,\n \"model\": \"gpt-4-turbo-2024-04-09\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"{\\n \\\"answer\\\": \\\"The American Civil War, fought from 1861 to 1865, was a defining conflict in United States history, intensively driven by issues of states' rights, and fundamentally, the institution of slavery. The eruption of war followed the 1860 election of Abraham Lincoln, leading to the secession of seven Southern slave-holding states and the establishment of the Confederate States of America. The war commenced with the Confederate attack on Fort Sumter in South Carolina on April 12, 1861, which prompted President Lincoln to call for troops, causing more states to join the Confederacy.\\\\n\\\\nAn early pivotal battle was the Battle of Gettysburg in 1863, which, occurring four months prior to Lincoln's famous Gettysburg Address, marked a turning point. The battle was one of the bloodiest, with over 45,000 men killed, injured, captured, or missing. Lincoln's Gettysburg Address, delivered at the dedication of a military cemetery there, has since been celebrated as a profound reminder of the war's higher purpose\u2014highlighting themes of human equality and the enduring value of democracy.\\\"\\n}\\n```\",\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 4604,\n \"completion_tokens\": 238,\n \"total_tokens\": 4842,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0\n }\n },\n \"system_fingerprint\": \"fp_eae715ec6a\"\n}\n" +} diff --git a/tests/Fixtures/Saloon/AgentChains/Rat/RatAgentChain-475d90e301668292a051dde550aee5a3.json b/tests/Fixtures/Saloon/AgentChains/Rat/RatAgentChain-475d90e301668292a051dde550aee5a3.json new file mode 100644 index 0000000..bdab6cb --- /dev/null +++ b/tests/Fixtures/Saloon/AgentChains/Rat/RatAgentChain-475d90e301668292a051dde550aee5a3.json @@ -0,0 +1,11 @@ +{ + "statusCode": 200, + "headers": { + "Date": "Tue, 22 Oct 2024 23:59:07 GMT", + "Content-Type": "application\/json", + "Content-Length": "1980", + "Connection": "keep-alive", + "access-control-expose-headers": "X-Request-ID" + }, + "data": "{\n \"id\": \"chatcmpl-ALJ47vKbJUXDkl423CUWyfEeYdRN9\",\n \"object\": \"chat.completion\",\n \"created\": 1729641539,\n \"model\": \"gpt-4-turbo-2024-04-09\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"{\\n \\\"answer\\\": \\\"The American Civil War, fought from 1861 to 1865, was a pivotal conflict in United States history, primarily over the issues of states' rights, and more fundamentally, the institution of slavery. The war erupted after the election of Abraham Lincoln in 1860, leading to the secession of seven Southern slave states and the formation of the Confederate States of America. The conflict was precipitated by the Confederate attack on Fort Sumter in South Carolina on April 12, 1861, prompting President Lincoln to issue a call for troops, which led to more states joining the Confederacy.\\\\n\\\\nKey early battles included Bull Run and the Battle of Shiloh, demonstrating that the conflict would be neither quick nor easy. In 1862, the Emancipation Proclamation promised freedom to slaves in Confederate states, reframing the war as a struggle not just for union but also for human freedom. The Battle of Antietam, on September 17, 1862, marked one of the deadliest days in American military history and was significant not just militarily but for its political outcomes as well\u2014providing President Lincoln the momentum needed to issue the preliminary Emancipation Proclamation. This decree, which promised to free slaves in rebel states, changed the trajectory of the war and solidified the moral grounds of the Union cause.\\\"\\n}\\n```\",\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 7218,\n \"completion_tokens\": 280,\n \"total_tokens\": 7498,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0\n }\n },\n \"system_fingerprint\": \"fp_eae715ec6a\"\n}\n" +} diff --git a/tests/Fixtures/Saloon/AgentChains/Rat/RatAgentChain-72d3babdd785f7230e988f2e032f473d.json b/tests/Fixtures/Saloon/AgentChains/Rat/RatAgentChain-72d3babdd785f7230e988f2e032f473d.json new file mode 100644 index 0000000..5e91bf4 --- /dev/null +++ b/tests/Fixtures/Saloon/AgentChains/Rat/RatAgentChain-72d3babdd785f7230e988f2e032f473d.json @@ -0,0 +1,10 @@ +{ + "statusCode": 200, + "headers": { + "Date": "Tue, 22 Oct 2024 23:59:09 GMT", + "Content-Type": "application/json", + "Content-Length": "724", + "Connection": "keep-alive" + }, + "data": "{\n \"id\": \"chatcmpl-ALJ4GnKkb2OOggdv6jP2hTMUmIbnz\",\n \"object\": \"chat.completion\",\n \"created\": 1729641548,\n \"model\": \"gpt-4-turbo-2024-04-09\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"{\\n \\\"query\\\": \\\"Significance of Gettysburg Address 1863, impact on American Civil War\\\"\\n}\\n```\",\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 545,\n \"completion_tokens\": 26,\n \"total_tokens\": 571,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0\n }\n },\n \"system_fingerprint\": \"fp_eae715ec6a\"\n}\n" +} diff --git a/tests/Fixtures/Saloon/AgentChains/Rat/RatAgentChain-bc0c986806c46d9aa119053ac316b3ce.json b/tests/Fixtures/Saloon/AgentChains/Rat/RatAgentChain-bc0c986806c46d9aa119053ac316b3ce.json new file mode 100644 index 0000000..745b5ac --- /dev/null +++ b/tests/Fixtures/Saloon/AgentChains/Rat/RatAgentChain-bc0c986806c46d9aa119053ac316b3ce.json @@ -0,0 +1,10 @@ +{ + "statusCode": 200, + "headers": { + "Date": "Tue, 22 Oct 2024 23:59:50 GMT", + "Content-Type": "application\/json", + "Transfer-Encoding": "chunked", + "Connection": "keep-alive" + }, + "data": "{\n \"id\": \"chatcmpl-ALJ4oqf51aXN1zvkO1oujJ3hEVZ7g\",\n \"object\": \"chat.completion\",\n \"created\": 1729641582,\n \"model\": \"gpt-4-turbo-2024-04-09\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"{\\n \\\"answer\\\": \\\"### Timeline of the American Civil War\\\\n\\\\n#### Prelude to Conflict\\\\nThe American Civil War, which spanned from 1861 to 1865, was a pivotal conflict in the history of the United States largely centered around issues of slavery and states' rights. Following the election of Abraham Lincoln in 1860, disunion sentiments heightened, leading to the secession of several Southern states to form the Confederate States of America. The formal beginning of the war was marked by the Confederate bombardment of Fort Sumter on April 12, 1861, prompting Lincoln's call for troops and triggering further secessions.\\\\n\\\\n#### Turning Points and Key Battles\\\\nA crucial turning point in the conflict was the Battle of Gettysburg in July 1863, one of the bloodiest battles over three days, which ended in a significant defeat for the Confederates. This battle was later commemorated by President Lincoln's Gettysburg Address, which underscored the war's purpose of preserving a nation dedicated to the principles of equality and democracy.\\\\n\\\\n#### Conclusion and Aftermath\\\\nIn the concluding years of the war, under the leadership of General Ulysses S. Grant, the Union forces launched decisive campaigns, leading eventually to the fall of key Southern cities and the surrender of General Robert E. Lee at Appomattox Court House on April 9, 1865. The war officially concluded with further surrenders across the Confederate armies and marked a profound transformation in American society, leading into the period known as Reconstruction, aimed at re-integrating the seceded states and abolishing slavery.\\\"\\n}\\n```\",\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 480,\n \"completion_tokens\": 344,\n \"total_tokens\": 824,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0\n }\n },\n \"system_fingerprint\": \"fp_eae715ec6a\"\n}\n" +} diff --git a/tests/Fixtures/Saloon/AgentChains/Rat/RatAgentChain-d5c8e692581754f3aac57899f4c2603f.json b/tests/Fixtures/Saloon/AgentChains/Rat/RatAgentChain-d5c8e692581754f3aac57899f4c2603f.json new file mode 100644 index 0000000..879e9c6 --- /dev/null +++ b/tests/Fixtures/Saloon/AgentChains/Rat/RatAgentChain-d5c8e692581754f3aac57899f4c2603f.json @@ -0,0 +1,10 @@ +{ + "statusCode": 200, + "headers": { + "Date": "Tue, 22 Oct 2024 23:58:37 GMT", + "Content-Type": "application\/json", + "Transfer-Encoding": "chunked", + "Connection": "keep-alive" + }, + "data": "{\n \"id\": \"chatcmpl-ALJ3blWUIa2V98gyv5PyEKSjrbTxf\",\n \"object\": \"chat.completion\",\n \"created\": 1729641507,\n \"model\": \"gpt-4-turbo-2024-04-09\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"{\\n \\\"answer\\\": \\\"The American Civil War, fought from 1861 to 1865, was a pivotal conflict in United States history, primarily about states' rights and slavery. The war began after several Southern states seceded from the Union, forming the Confederate States of America in response to the election of Abraham Lincoln in 1860 and the growing tensions related to slavery.\\\\n\\\\nIn 1861, the conflict officially commenced with the Confederate attack on Fort Sumter in South Carolina on April 12th. This led President Lincoln to call for 75,000 volunteers, sparking additional Southern states to secede. The key early battles included Bull Run and the Battle of Shiloh, indicating that the war would be longer and more brutal than initially anticipated.\\\\n\\\\nBy 1862, the war had expanded across multiple fronts. Key events include the introduction of the Emancipation Proclamation by President Lincoln, which declared all slaves in Confederate states to be free, turning the conflict more distinctly into a war about slavery as well as state rights. Major battles like Antietam, which remains one of the deadliest single-day battles in American history, further underscored the ferocity of the conflict.\\\\n\\\\nThe year 1863 is marked significantly by the Battle of Gettysburg and the Siege of Vicksburg. These were pivotal Union victories that significantly turned the tide of the war. The Gettysburg Address, delivered by Lincoln in November, redefined the purpose of the war and is one of the most famous speeches in American history.\\\\n\\\\nIn 1864-65, General Ulysses S. Grant led the Union forces in a series of battles that gradually crushed the Confederate resistance. Sherman's March to the Sea further devastated the South's infrastructure and economy. The war concluded with the surrender of Confederate General Robert E. Lee to Grant at Appomattox Court House on April 9, 1865. The aftermath of the war involved Reconstruction, a period of rebuilding and integrating the Southern states back into the Union, marked by significant social, economic, and legislative changes.\\\"\\n}\\n```\",\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 120,\n \"completion_tokens\": 430,\n \"total_tokens\": 550,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0\n }\n },\n \"system_fingerprint\": \"fp_eae715ec6a\"\n}\n" +} diff --git a/tests/Fixtures/Saloon/AgentChains/Rat/RatAgentChain-ebe56fdb70a6f5dc2640a5e4b73366bc.json b/tests/Fixtures/Saloon/AgentChains/Rat/RatAgentChain-ebe56fdb70a6f5dc2640a5e4b73366bc.json new file mode 100644 index 0000000..7d43245 --- /dev/null +++ b/tests/Fixtures/Saloon/AgentChains/Rat/RatAgentChain-ebe56fdb70a6f5dc2640a5e4b73366bc.json @@ -0,0 +1,10 @@ +{ + "statusCode": 200, + "headers": { + "Date": "Tue, 22 Oct 2024 23:59:42 GMT", + "Content-Type": "application\/json", + "Transfer-Encoding": "chunked", + "Connection": "keep-alive" + }, + "data": "{\n \"id\": \"chatcmpl-ALJ4gmVxvqX31vwKeueb1yEcpPVqE\",\n \"object\": \"chat.completion\",\n \"created\": 1729641574,\n \"model\": \"gpt-4-turbo-2024-04-09\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"{\\n \\\"answer\\\": \\\"The American Civil War, which spanned from 1861 to 1865, was a pivotal conflict in the history of the United States largely centered around issues of slavery and states' rights. Following the election of Abraham Lincoln in 1860, disunion sentiments heightened, leading to the secession of several Southern states to form the Confederate States of America. The formal beginning of the war was marked by the Confederate bombardment of Fort Sumter on April 12, 1861, prompting Lincoln's call for troops and triggering further secessions.\\\\n\\\\nA crucial turning point in the conflict was the Battle of Gettysburg in July 1863, one of the bloodiest battles over three days, which ended in a significant defeat for the Confederates. This battle was later commemorated by President Lincoln's Gettysburg Address, which underscored the war's purpose of preserving a nation dedicated to the principles of equality and democracy.\\\\n\\\\nIn the concluding years of the war, under the leadership of General Ulysses S. Grant, the Union forces launched decisive campaigns, leading eventually to the fall of key Southern cities and the surrender of General Robert E. Lee at Appomattox Court House on April 9, 1865. The war officially concluded with further surrenders across the Confederate armies and marked a profound transformation in American society, leading into the period known as Reconstruction, aimed at re-integrating the seceded states and abolishing slavery.\\\"\\n}\\n```\",\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 10459,\n \"completion_tokens\": 309,\n \"total_tokens\": 10768,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0\n }\n },\n \"system_fingerprint\": \"fp_eae715ec6a\"\n}\n" +} diff --git a/tests/Fixtures/Saloon/AgentChains/Rat/RatAgentChain-f709b10afe10f8e52425993b58e251a0.json b/tests/Fixtures/Saloon/AgentChains/Rat/RatAgentChain-f709b10afe10f8e52425993b58e251a0.json new file mode 100644 index 0000000..4b44487 --- /dev/null +++ b/tests/Fixtures/Saloon/AgentChains/Rat/RatAgentChain-f709b10afe10f8e52425993b58e251a0.json @@ -0,0 +1,10 @@ +{ + "statusCode": 200, + "headers": { + "Date": "Tue, 22 Oct 2024 23:58:50 GMT", + "Content-Type": "application\/json", + "Content-Length": "765", + "Connection": "keep-alive" + }, + "data": "{\n \"id\": \"chatcmpl-ALJ3xuMTKxEYmoZQsKpeSwsfdtAti\",\n \"object\": \"chat.completion\",\n \"created\": 1729641529,\n \"model\": \"gpt-4-turbo-2024-04-09\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"{\\n \\\"query\\\": \\\"\\\\\\\"American Civil War\\\\\\\" timeline 1861 \\\\\\\"Fort Sumter\\\\\\\" \\\\\\\"Bull Run\\\\\\\" \\\\\\\"Battle of Shiloh\\\\\\\" effects\\\"\\n}\\n```\",\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 353,\n \"completion_tokens\": 35,\n \"total_tokens\": 388,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0\n }\n },\n \"system_fingerprint\": \"fp_eae715ec6a\"\n}\n" +} diff --git a/tests/Fixtures/Saloon/AgentChains/Rat/RatAgentChain-ff5f3fc0f8a597f498ab55b7f934f5f1.json b/tests/Fixtures/Saloon/AgentChains/Rat/RatAgentChain-ff5f3fc0f8a597f498ab55b7f934f5f1.json new file mode 100644 index 0000000..56e6478 --- /dev/null +++ b/tests/Fixtures/Saloon/AgentChains/Rat/RatAgentChain-ff5f3fc0f8a597f498ab55b7f934f5f1.json @@ -0,0 +1,10 @@ +{ + "statusCode": 200, + "headers": { + "Date": "Tue, 22 Oct 2024 23:59:26 GMT", + "Content-Type": "application\/json", + "Content-Length": "866", + "Connection": "keep-alive" + }, + "data": "{\n \"id\": \"chatcmpl-ALJ4XBVUCOJP47TDmq0z20WLj7bhl\",\n \"object\": \"chat.completion\",\n \"created\": 1729641565,\n \"model\": \"gpt-4-turbo-2024-04-09\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"{\\n \\\"query\\\": \\\"American Civil War summary timeline, Battle of Gettysburg 1863, General Grant's leadership, Sherman's March to the Sea, Confederate General Lee's surrender at Appomattox Court House 1865, post-war Reconstruction\\\"\\n}\\n```\",\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 553,\n \"completion_tokens\": 56,\n \"total_tokens\": 609,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0\n }\n },\n \"system_fingerprint\": \"fp_eae715ec6a\"\n}\n" +} diff --git a/tests/Fixtures/Saloon/AgentChains/Rat/RatAgentChainFirecrawlTool-073fd35020257fc589393e63f7775273.json b/tests/Fixtures/Saloon/AgentChains/Rat/RatAgentChainFirecrawlTool-073fd35020257fc589393e63f7775273.json new file mode 100644 index 0000000..a87e71e --- /dev/null +++ b/tests/Fixtures/Saloon/AgentChains/Rat/RatAgentChainFirecrawlTool-073fd35020257fc589393e63f7775273.json @@ -0,0 +1,8 @@ +{ + "statusCode": 200, + "headers": { + "X-Powered-By": "Express", + "Access-Control-Allow-Origin": "*" + }, + "data": "{\"success\":true,\"data\":{\"markdown\":\"We use cookies to understand how you use our site, improve your experience, and personalize content. To learn more, [click here](https:\/\/www.battlefields.org\/about\/accountability\/privacy-policy#cookies)\\n. By continuing to use our site, you accept our use of cookies, [Privacy Policy](https:\/\/www.battlefields.org\/about\/accountability\/privacy-policy)\\n, and [Terms of Service](https:\/\/www.battlefields.org\/terms-service)\\n.\\n\\nI agree [More info](https:\/\/www.battlefields.org\/about\/accountability\/privacy-policy#cookies)\\n Reject cookies\\n\\n[Skip to main content](#main-content)\\n\\n[My Library](\/learn\/educators\/my-library)\\n\\n ![This is an image depicting casualties on the Antietam battlefield. ](https:\/\/www.battlefields.org\/sites\/default\/files\/styles\/hero_large\/public\/thumbnails\/image\/Antietam%20Battle%20Page%20Hero_0.jpg?h=1a7cb72a&itok=XKHEKkMd)\\n\\nAntietam\\n========\\n\\nSharpsburg\\n----------\\n\\nWatch Antietam: Animated Battle Map\\n\\nClose Video\\n\\nAlso offered in: [Espa\u00f1ol](\/learn\/civil-war\/battles\/antietam-espanol)\\n\\nWashington County, MD\u00a0\u00a0|\u00a0\u00a0Sep 17, 1862\\n--------------------------------------\\n\\nAntietam, the deadliest one-day battle in American military history, showed that the Union could stand against the Confederate army in the Eastern theater. It also gave President Abraham Lincoln the confidence to issue the preliminary Emancipation Proclamation at a moment of strength rather than desperation.\\n\\n#### **How it ended**\\n\\nInconclusive. General Robert E. Lee committed his entire force to the battle, while Maj. Gen. George B. McClellan sent in less than three quarters of his. With the full commitment of McClellan\u2019s troops, which outnumbered the Confederates two to one, the battle might have had a more definitive outcome. Instead, McClellan\u2019s half-hearted approach allowed Lee to hold ground by shifting forces from threat to threat.\\n\\n#### **In context**\\n\\nLee invaded Maryland in September 1862 with a full agenda. He wanted to move the focus of fighting away from the South and into Federal territory. Victories there, could lead to the capture of the Federal capital in Washington, D.C. Confederate success could also influence impending Congressional elections in the North and persuade European nations to recognize the Confederate States of America. On the other side, President Abraham Lincoln was counting on McClellan to bring him the victory he needed to keep Republican control of the Congress and issue a preliminary Emancipation Proclamation.\\n\\nBefore the Battle\\n\\nThe first Confederate invasion of Union-held territory is not going as planned. After a Union victory at [the Battle of South Mountain](https:\/\/www.battlefields.org\/learn\/civil-war\/battles\/south-mountain)\\n and a Confederate victory at [the Battle of Harpers Ferry](https:\/\/www.battlefields.org\/learn\/civil-war\/battles\/harpers-ferry)\\n, Confederate general Robert E. Lee opts to make one last stand in the hopes of salvaging his Maryland Campaign.\\n\\nWith Federal forces closing in from the east, Lee selects strategic ground near Antietam Creek and orders his army to converge there. A mile east of the town of Sharpsburg, the creek meanders through the hilly but open countryside, good for long-range artillery and moving infantry. The water is deep, swift, and crossable only at three stone bridges, making it a natural defensible location. On September 15, Lee positions his men behind the creek and waits for McClellan to arrive.\\n\\nOn the afternoon of September 16, Union general George B. McClellan sets his army in motion, sending Maj. Gen. Joseph Hooker\u2019s First Corps across Antietam Creek to find Lee\u2019s left flank. At dusk, Hooker bumps into Confederate general John Bell Hood\u2019s division and the two forces skirmish until dark. The following morning, McClellan attacks.\\n\\nDuring the Battle\\n\\n[![Portrait of George B. McClellan](https:\/\/www.battlefields.org\/sites\/default\/files\/styles\/squarish\/public\/thumbnails\/image\/General%20George%20B%20McClellan%20Square.jpg?h=d8c3850d&itok=TwTCmLat)](\/learn\/biographies\/george-b-mcclellan)\\n\\nUnion\\n\\n[George B. McClellan](\/learn\/biographies\/george-b-mcclellan)\\n\\n[![Portrait of Robert E. Lee](https:\/\/www.battlefields.org\/sites\/default\/files\/styles\/squarish\/public\/thumbnails\/image\/Robert%20E.%20Lee.jpg?h=d8c3850d&itok=wdGXCQTD)](\/learn\/biographies\/robert-e-lee)\\n\\nConfederate\\n\\n[Robert E. Lee](\/learn\/biographies\/robert-e-lee)\\n\\nForces Engaged\\n\\n132,000\\n\\nUnion \\n87,000\\n\\nConfed. \\n45,000\\n\\nSeptember 17. The Battle of Antietam begins at dawn when Hooker\u2019s Union corps mounts a powerful assault on Lee\u2019s left flank. Repeated Union attacks and equally vicious Confederate counterattacks sweep back and forth across Miller\u2019s cornfield and the West Woods. Hooker sees thousands of his Federals felled in the corn rows, where, \u201cevery stalk of corn in the northern and greater part of the field was cut as closely as could have been done with a knife, and the slain lay in rows precisely as they had stood in their ranks a few moments before.\u201d Despite the great Union numerical advantage, Lt. Gen. Stonewall Jackson\u2019s Confederate forces hold their ground near the Dunker Church.\\n\\nMeanwhile, towards the center of the battlefield, Union assaults against the Sunken Road pierce the Confederate center after a terrible struggle for this key defensive position. Unfortunately for the Union, this temporal advantage in the center is not followed up with further advances and eventually the Union defenders must abandon their position.\\n\\nIn the afternoon, the third and final major assault by Maj. Gen. Ambrose E. Burnside's Ninth Corps pushes over a bullet-strewn stone bridge at Antietam Creek. (Today it\u2019s called Burnside Bridge.) Just as Burnside's forces begin to collapse the Confederate right, Maj. Gen. A.P. Hill\u2019s division charges into battle after a long march from Harpers Ferry, helping drive back the assault and saving the day for the Army of Northern Virginia.\\n\\nAftermath\\n\\nUnion\\n\\n12,401\\n\\n2,108 killed\\n\\n9,540 wounded\\n\\n753 missing & captured\\n\\nEstimated Casualties\\n\\n22,717\\n\\nUnion \\n12,401\\n\\nConfed. \\n10,316\\n\\nConfederate\\n\\n10,316\\n\\n1,546 killed\\n\\n7,752 wounded\\n\\n1,018 missing & captured\\n\\nThere are more than 22,000 casualties at the Battle of Antietam. Doctors at the scene are overwhelmed. Badly needed supplies are brought in by nurse Clara Barton, known as the \u201cAngel of the Battlefield.\u201d During the night, both armies tend their wounded and consolidate their lines. In spite of his diminished ranks, Lee continues to skirmish with McClellan on September 18, while removing his wounded south of the Potomac River. Late that evening and on September 19, after realizing that no further attacks are coming from McClellan, Lee withdraws from the battlefield and slips back across the Potomac into Virginia. McClellan sends Maj. Gen. Fitz John Porter to mount a cautious pursuit, which is repulsed at [the Battle of Shepherdstown](https:\/\/www.battlefields.org\/learn\/civil-war\/battles\/shepherdstown)\\n.\\n\\nWhile the Battle of Antietam is considered a tactical draw, President Lincoln claims a strategic victory. Lincoln has been waiting for a military success to issue his preliminary [Emancipation Proclamation](https:\/\/www.battlefields.org\/learn\/articles\/10-facts-emancipation-proclamation)\\n. He takes his opportunity on September 22. The Proclamation, which vows to free the slaves of all states still in rebellion as of January 1, 1863, will forever change the course of the war and the nation by marrying the Union cause with an attack on the institution of slavery. Hesitant to support a pro-slavery regime, England and France decline to form an alliance with the Confederate States of America.\\n\\nAfter McClellan fails to pursue Lee on his retreat south, Lincoln loses faith in his general. Weeks later, he names Burnside commander of the Army of the Potomac.\\n\\nQuestions to Consider\\n\\n1\\\\. Why did Lincoln lose faith in George McClellan\u2019s command after Antietam?\\n\\nLincoln and McClellan had a tortured relationship. McClellan\u2019s letters reveal his contempt for his commander-in-chief (whom he sometimes referred to as \u201cthe Gorilla\u201d), and the historical record shows that as the war slogged on, Lincoln became increasingly frustrated with his general\u2019s timidity and excuses. He believed McClellan spent too much of his command drilling troops and little of it pursuing Lee. Lincoln called the general\u2019s \u201ccondition\u201d a bad case of \u201cthe slows.\u201d\\n\\nThough well-liked by his men, McClellan could be vain and boastful. After he failed to attack Lee\u2019s depleted troops as they fled Sharpsburg on September 18, he wrote to his wife, Ellen, that, ''those in whose judgment I rely tell me that I fought the battle splendidly & that it was a masterpiece of art.''\u00a0 Lincoln disagreed. He could not understand why his general was not on the tail of the Confederates, and he went to McClellan\u2019s headquarters at Antietam to light a fire under him. In a letter to his wife, Mary, Lincoln joked, \u201cWe are about to be photographed. . . \\\\[if\\\\] we can sit still long enough. I feel Gen. M. should have no problem.\u201d\\n\\nSix weeks after Antietam, McClellan finally heeded his boss\u2019s advice and led the Army of the Potomac into Virginia, but at a snail\u2019s pace. Even before the nine-day trek, Lincoln had all but given up on the man who had once been christened \u201cYoung Napoleon\u201d for his military promise. The president relieved McClellan of his duties on November 7 and appointed Maj. Gen. Ambrose Burnside to be his replacement.\\n\\nAfter losing his command, McClellan took up a new career\u2014politics. In the 1864 election he was the Democratic nominee for president of the United States. His opponent, Abraham Lincoln, was reelected for another term.\\n\\n2\\\\. Why is nurse Clara Barton considered a hero of Antietam?\\n\\nClarissa \u201cClara\u201d Harlowe Barton was a former teacher and patent clerk who became a nurse on the front lines during the Civil War. Despite having no prior experience and receiving no payment for her services, she bravely drove her cart of medical supplies into the fray at many battles, including Antietam. She saw the desperation of the wounded and dying and did what she could to aid and comfort them. Dr. James Dunn, a surgeon at the Battle of Antietam lauded her efforts:\\n\\nThe rattle of 150,000 muskets, and the fearful thunder of over 200 cannon, told us that the great battle of Antietam had commenced. I was in the hospital in the afternoon, for it was then only that the wounded began to come in. We had expended every bandage, tore up every sheet in the house, and everything we could find, when who should drive up but our old friend, Miss Barton, with a team loaded down with dressings of every kind, and everything we could ask for. . . .In my feeble estimation, General McClellan, with all his laurels, sinks into insignificance beside the true heroine of the age, _the angel of the battle field_.\\n\\nLater in the war, Lincoln authorized Barton to form the Office of Correspondence with Friends of Missing Men in the United States Army, an effort that eventually identified 22,000 missing Union soldiers. In 1881 Barton founded the American Red Cross.\\n\\nAntietam: Featured Resources\\n----------------------------\\n\\n[![Two trees set against a vivid purple sky at Antietam National Battlefield](https:\/\/www.battlefields.org\/sites\/default\/files\/styles\/squarish\/public\/Antietam_BuddySecor_1E2A9575-Antietam-%28Secor-2017%29-HiRez.jpg?h=89182231&itok=_LxpqldD)](\/learn\/quizzes\/how-well-do-know-battle-antietam)\\n\\n[Civil War](\/search?algolia_search_index[refinementList][title_1][]=71)\\n\u00a0\u00a0|\u00a0\u00a0[Quiz](\/search?algolia_search_index[refinementList][field_resource_type][]=quiz)\\n\\n### [How Well Do Know the Battle of Antietam?](\/learn\/quizzes\/how-well-do-know-battle-antietam)\\n\\n[![Photograph of McClellan discussing business in a tent](https:\/\/www.battlefields.org\/sites\/default\/files\/styles\/squarish\/public\/thumbnails\/image\/ls_0.jpg?h=a4080807&itok=fhoiquCF)](\/learn\/articles\/mcclellan-antietam)\\n\\n[Civil War](\/search?algolia_search_index[refinementList][title_1][]=71)\\n\u00a0\u00a0|\u00a0\u00a0[Article](\/search?algolia_search_index[refinementList][field_resource_type][]=article)\\n\\n### [McClellan at Antietam](\/learn\/articles\/mcclellan-antietam)\\n\\n[![](https:\/\/www.battlefields.org\/sites\/default\/files\/styles\/squarish\/public\/thumbnails\/image\/Antietam_Elliot_Map_Segment_0.jpg?h=8dd85f47&itok=Gm_KIKQI)](\/learn\/articles\/nineteenth-century-geolocation-elliott-map-antietam)\\n\\n[Civil War](\/search?algolia_search_index[refinementList][title_1][]=71)\\n\u00a0\u00a0|\u00a0\u00a0[Article](\/search?algolia_search_index[refinementList][field_resource_type][]=article)\\n\\n### [Nineteenth-Century Geolocation: The Elliott Map of Antietam](\/learn\/articles\/nineteenth-century-geolocation-elliott-map-antietam)\\n\\n[![Screenshot of the Antietam animated map](https:\/\/www.battlefields.org\/sites\/default\/files\/styles\/squarish\/public\/thumbnails\/image\/Screen%20Shot%202017-04-04%20at%2011.53.15%20AM.png?h=ad937be1&itok=lQBmQ62R)](\/learn\/maps\/antietam-animated-map)\\n\\n[Civil War](\/search?algolia_search_index[refinementList][title_1][]=71)\\n\u00a0\u00a0|\u00a0\u00a0[Video](\/search?algolia_search_index[refinementList][field_resource_type][]=video)\\n\\n### [Antietam Animated Map](\/learn\/maps\/antietam-animated-map)\\n\\n[![A portrait of Abraham Lincoln bordered by two American flags](https:\/\/www.battlefields.org\/sites\/default\/files\/styles\/squarish\/public\/thumbnails\/image\/Emancipation%20Proclamation%2010%20Facts.jpg?h=d86166dc&itok=4hGdn5CI)](\/learn\/articles\/10-facts-emancipation-proclamation)\\n\\n[Civil War](\/search?algolia_search_index[refinementList][title_1][]=71)\\n\u00a0\u00a0|\u00a0\u00a0[Article](\/search?algolia_search_index[refinementList][field_resource_type][]=article)\\n\\n### [10 Facts: The Emancipation Proclamation](\/learn\/articles\/10-facts-emancipation-proclamation)\\n\\n[![Photograph of the train and bridge at Harper's Ferry](https:\/\/www.battlefields.org\/sites\/default\/files\/styles\/squarish\/public\/thumbnails\/image\/Harpers%20Ferry%20Hero.jpg?h=d86166dc&itok=XSRICoSZ)](\/learn\/civil-war\/battles\/harpers-ferry)\\n\\n[Civil War](\/search?algolia_search_index[refinementList][title_1][]=71)\\n\u00a0\u00a0|\u00a0\u00a0[Battle](\/search?type[]=battle)\\n\\n### [Harpers Ferry](\/learn\/civil-war\/battles\/harpers-ferry)\\n\\n[![A distant photograph of Dunker Church at Antietam](https:\/\/www.battlefields.org\/sites\/default\/files\/styles\/squarish\/public\/thumbnails\/image\/Artillery%20Hell%20at%20the%20Dunker%20Church_1.jpg?h=d7680848&itok=Q2bcSAJC)](\/learn\/articles\/antietam-federal-flank-attack-dunker-church)\\n\\n[Civil War](\/search?algolia_search_index[refinementList][title_1][]=71)\\n\u00a0\u00a0|\u00a0\u00a0[Article](\/search?algolia_search_index[refinementList][field_resource_type][]=article)\\n\\n### [Antietam: Federal Flank Attack at Dunker Church](\/learn\/articles\/antietam-federal-flank-attack-dunker-church)\\n\\n[![This is an image of the Antietam App icon.](https:\/\/www.battlefields.org\/sites\/default\/files\/styles\/squarish\/public\/thumbnails\/image\/antietam-landscape.jpg?h=a4080807&itok=GNFrqfNJ)](\/visit\/mobile-apps\/antietam-battle-app)\\n\\n[Civil War](\/search?algolia_search_index[refinementList][title_1][]=71)\\n\u00a0\u00a0|\u00a0\u00a0[Mobile App](\/search?algolia_search_index[refinementList][field_resource_type][]=mobile_app)\\n\\n### [Antietam Battle App](\/visit\/mobile-apps\/antietam-battle-app)\\n\\n[![Cover of the \\\"Long Road to Antietam\\\"](https:\/\/www.battlefields.org\/sites\/default\/files\/styles\/squarish\/public\/thumbnails\/image\/Long-Road-To-Antietam-%28Landscape%29.jpg?h=a4080807&itok=w4jLXDfv)](\/learn\/articles\/book-long-road-antietam)\\n\\n[Civil War](\/search?algolia_search_index[refinementList][title_1][]=71)\\n\u00a0\u00a0|\u00a0\u00a0[Article](\/search?algolia_search_index[refinementList][field_resource_type][]=article)\\n\\n### [Book: The Long Road to Antietam](\/learn\/articles\/book-long-road-antietam)\\n\\n[![](https:\/\/www.battlefields.org\/sites\/default\/files\/styles\/squarish\/public\/thumbnails\/image\/Antietam_MattBrant_DunkerChurch_FromWestWoods_BW.jpg?h=5234f34a&itok=7UqDyn0c)](\/learn\/articles\/lessons-fallen-depictions-dead-antietam)\\n\\n[Civil War](\/search?algolia_search_index[refinementList][title_1][]=71)\\n\u00a0\u00a0|\u00a0\u00a0[Article](\/search?algolia_search_index[refinementList][field_resource_type][]=article)\\n\\n### [Lessons From the Fallen: Depictions of the Dead of Antietam](\/learn\/articles\/lessons-fallen-depictions-dead-antietam)\\n\\n[![](https:\/\/www.battlefields.org\/sites\/default\/files\/styles\/squarish\/public\/thumbnails\/image\/Antietam_Elliot_Map_Segment_0.jpg?h=8dd85f47&itok=Gm_KIKQI)](\/learn\/maps\/antietam-sg-elliott-burial-map)\\n\\n[Civil War](\/search?algolia_search_index[refinementList][title_1][]=71)\\n\u00a0\u00a0|\u00a0\u00a0[Historical Map](\/search?algolia_search_index[refinementList][field_resource_type][]=history_map)\\n\\n### [Antietam - S.G. Elliott Burial Map](\/learn\/maps\/antietam-sg-elliott-burial-map)\\n\\n[![Antietam | Sunken Road | Sep 17, 1862 | 9:30 am - 1:00 pm](https:\/\/www.battlefields.org\/sites\/default\/files\/styles\/squarish\/public\/Antietam_sunken-road_930-am-to-1pm_Sept-17-1862-%28August-2023%29.jpg?h=a4e5fa57&itok=xmbHsrRt)](\/learn\/maps\/antietam-sunken-road-sep-17-1862)\\n\\n[Civil War](\/search?algolia_search_index[refinementList][title_1][]=71)\\n\u00a0\u00a0|\u00a0\u00a0[Battle Map](\/search?algolia_search_index[refinementList][field_resource_type][]=battle_map)\\n\\n### [Antietam | Sunken Road | Sep 17, 1862](\/learn\/maps\/antietam-sunken-road-sep-17-1862)\\n\\n[![Antietam | Burnside's Bridge | Sep 17, 1862 | 12:00 - 1:00 pm](https:\/\/www.battlefields.org\/sites\/default\/files\/styles\/squarish\/public\/Antietam_burnside-bridge_noon-to-1pm_Sept-17-1862-%28August-2023%29.jpg?h=08d962ad&itok=aI7956JL)](\/learn\/maps\/antietam-burnsides-bridge-sep-17-1862)\\n\\n[Civil War](\/search?algolia_search_index[refinementList][title_1][]=71)\\n\u00a0\u00a0|\u00a0\u00a0[Battle Map](\/search?algolia_search_index[refinementList][field_resource_type][]=battle_map)\\n\\n### [Antietam | Burnside's Bridge | Sep 17, 1862](\/learn\/maps\/antietam-burnsides-bridge-sep-17-1862)\\n\\n[![This is a sketch of Union soldiers lined up and ready for battle. ](https:\/\/www.battlefields.org\/sites\/default\/files\/styles\/squarish\/public\/thumbnails\/image\/default-history-troops_0.jpg?h=fc321e16&itok=Poka9YqY)](\/learn\/articles\/antietam)\\n\\n[Civil War](\/search?algolia_search_index[refinementList][title_1][]=71)\\n\u00a0\u00a0|\u00a0\u00a0[Article](\/search?algolia_search_index[refinementList][field_resource_type][]=article)\\n\\n### [Antietam](\/learn\/articles\/antietam)\\n\\n[Antietam: Search All Resources](\/search?algolia_search_index[refinementList][title_2][]=Antietam)\\n\\nAll battles of the Maryland Campaign\\n------------------------------------\\n\\n1\\n\\n2\\n\\n3\\n\\n4\\n\\n5\\n\\n500 km\\n\\n300 mi\\n\\n[+](# \\\"Zoom in\\\")\\n[\u2212](# \\\"Zoom out\\\")\\n\\n[](# \\\"View Fullscreen\\\")\\n\\n[Leaflet](http:\/\/leafletjs.com \\\"A JS library for interactive maps\\\")\\n\\nClick to view and interact with the map\\n\\n[Full Civil War Map](\/learn\/battles?historical_period=71)\\n\\n1\\n\\n[Civil War](\/search?algolia_search_index[refinementList][title_1][]=71)\\n\u00a0\u00a0|\u00a0\u00a0[Battle](\/search?type[]=battle)\\n\\nHarpers Ferry\\n\\nJefferson County, WV\u00a0\u00a0|\u00a0\u00a0Sep 12\u00a0-\u00a015, 1862\\n\\n**Result:** Confederate Victory \\n**Est. Casualties:** 12,922 \\n**Union:** 12,636 \\n**Confederate:** 286 \\n\\n2\\n\\n[Civil War](\/search?algolia_search_index[refinementList][title_1][]=71)\\n\u00a0\u00a0|\u00a0\u00a0[Battle](\/search?type[]=battle)\\n\\nSouth Mountain\\n\\nFrederick County and Washington County, MD\u00a0\u00a0|\u00a0\u00a0Sep 14, 1862\\n\\n**Result:** Union Victory \\n**Est. Casualties:** 5,010 \\n**Union:** 2,325 \\n**Confederate:** 2,685 \\n\\n3\\n\\n[Civil War](\/search?algolia_search_index[refinementList][title_1][]=71)\\n\u00a0\u00a0|\u00a0\u00a0[Battle](\/search?type[]=battle)\\n\\nLa batalla de Antietam\\n\\nWashington County, MD\u00a0\u00a0|\u00a0\u00a0Sep 16\u00a0-\u00a018, 1862\\n\\n**Result:** Union Victory \\n**Est. Casualties:** 22,717 \\n**Union:** 12,401 \\n**Confederate:** 10,316 \\n\\n4\\n\\n[Civil War](\/search?algolia_search_index[refinementList][title_1][]=71)\\n\u00a0\u00a0|\u00a0\u00a0[Battle](\/search?type[]=battle)\\n\\nAntietam\\n\\nWashington County, MD\u00a0\u00a0|\u00a0\u00a0Sep 17, 1862\\n\\n**Result:** Union Victory \\n**Est. Casualties:** 22,717 \\n**Union:** 12,401 \\n**Confederate:** 10,316 \\n\\n5\\n\\n[Civil War](\/search?algolia_search_index[refinementList][title_1][]=71)\\n\u00a0\u00a0|\u00a0\u00a0[Battle](\/search?type[]=battle)\\n\\nShepherdstown\\n\\nTown of Shepherdstown, WV\u00a0\u00a0|\u00a0\u00a0Sep 19\u00a0-\u00a020, 1862\\n\\n**Result:** Confederate Victory \\n**Est. Casualties:** 622 \\n**Union:** 361 \\n**Confederate:** 261 \\n\\nAdd to My Battlefields Educators Library\\n\\nRelated Battles\\n---------------\\n\\n[Battle Facts](\/learn\/civil-war\/battles\/antietam)\\n\\nWashington County, MD | September 17, 1862\\n\\nResult: Union Victory\\n\\nCommanders\\n\\n[![Portrait of George B. McClellan](https:\/\/www.battlefields.org\/sites\/default\/files\/styles\/squarish\/public\/thumbnails\/image\/General%20George%20B%20McClellan%20Square.jpg?h=d8c3850d&itok=TwTCmLat)](\/learn\/biographies\/george-b-mcclellan)\\n\\nUnion\\n\\n[George B. McClellan](\/learn\/biographies\/george-b-mcclellan)\\n\\n[![Portrait of Robert E. Lee](https:\/\/www.battlefields.org\/sites\/default\/files\/styles\/squarish\/public\/thumbnails\/image\/Robert%20E.%20Lee.jpg?h=d8c3850d&itok=wdGXCQTD)](\/learn\/biographies\/robert-e-lee)\\n\\nConfederate\\n\\n[Robert E. Lee](\/learn\/biographies\/robert-e-lee)\\n\\nForces Engaged\\n\\n132,000\\n\\nUnion \\n87,000\\n\\nConfed. \\n45,000\\n\\nEstimated Casualties\\n\\n22,717\\n\\nUnion \\n12,401\\n\\nConfed. \\n10,316\\n\\n[![This is an image of the Antietam battlefield at sunset. ](https:\/\/www.battlefields.org\/sites\/default\/files\/styles\/squarish\/public\/thumbnails\/image\/Antietam%20Battlefield%20Hero.jpg?h=d86166dc&itok=BlXSTN4V)](\/visit\/battlefields\/antietam-battlefield)\\n\\n### [Visit Antietam](\/visit\/battlefields\/antietam-battlefield)\\n\\nWidely considered to be one of the most beautiful, pristine and well-preserved Civil War battlefields, Antietam is a must-see for any Civil War...\\n\\n[Details and Itineraries \u00bb](\/visit\/battlefields\/antietam-battlefield)\\n\\n[![Photograph of the stone bridge at Antietam](https:\/\/www.battlefields.org\/sites\/default\/files\/styles\/squarish\/public\/thumbnails\/image\/Antietam%20360%20Hero.jpg?h=d86166dc&itok=FXc7cL4N)](\/visit\/virtual-tours\/antietam-360-virtual-tour)\\n\\n[Civil War](\/search?algolia_search_index[refinementList][title_1][]=71)\\n\u00a0\u00a0|\u00a0\u00a0[360\u00b0 Virtual Tour](\/search?type[]=virtual_tour)\\n\\n### [Antietam Virtual Tour](\/visit\/virtual-tours\/antietam-360-virtual-tour)\\n\\n![](https:\/\/t.co\/i\/adsct?bci=3&eci=2&event_id=c863ea1b-7bc5-40a5-96f8-116e853271b1&events=%5B%5B%22pageview%22%2C%7B%7D%5D%5D&integration=advertiser&p_id=Twitter&p_user_id=0&pl_id=dafbb5fc-3616-4b28-8370-12d1c2c33328&tw_document_href=https%3A%2F%2Fwww.battlefields.org%2Flearn%2Fcivil-war%2Fbattles%2Fantietam&tw_iframe_status=0&tw_order_quantity=0&tw_sale_amount=0&txn_id=ny98u&type=javascript&version=2.3.30)![](https:\/\/analytics.twitter.com\/i\/adsct?bci=3&eci=2&event_id=c863ea1b-7bc5-40a5-96f8-116e853271b1&events=%5B%5B%22pageview%22%2C%7B%7D%5D%5D&integration=advertiser&p_id=Twitter&p_user_id=0&pl_id=dafbb5fc-3616-4b28-8370-12d1c2c33328&tw_document_href=https%3A%2F%2Fwww.battlefields.org%2Flearn%2Fcivil-war%2Fbattles%2Fantietam&tw_iframe_status=0&tw_order_quantity=0&tw_sale_amount=0&txn_id=ny98u&type=javascript&version=2.3.30)\\n\\n![](https:\/\/bat.bing.com\/action\/0?ti=142000833&Ver=2&mid=0df38fd2-37eb-4c27-b0f9-126134244ee7&bo=1&sid=99f5a55090d111efab6071f134391ce9&vid=99f5e7e090d111efbfccf93e7a9f88d2&vids=1&msclkid=N&pi=918639831&lg=en-US&sw=1280&sh=1024&sc=24&tl=Antietam%20Battle%20Facts%20and%20Summary%20%7C%20American%20Battlefield%20Trust&p=https%3A%2F%2Fwww.battlefields.org%2Flearn%2Fcivil-war%2Fbattles%2Fantietam&r=<=1679&evt=pageLoad&sv=1&cdb=AQAA&rn=543974)\",\"metadata\":{\"title\":\"Antietam Battle Facts and Summary | American Battlefield Trust\",\"description\":\"Battle of Antietam page - battle maps, history articles, photos, and preservation news on this important 1862 Civil War battle in Maryland.\",\"language\":\"en\",\"robots\":\"index, follow\",\"ogTitle\":\"Antietam\",\"ogDescription\":\"Battle of Antietam page - battle maps, history articles, photos, and preservation news on this important 1862 Civil War battle in Maryland.\",\"ogUrl\":\"https:\/\/www.battlefields.org\/learn\/civil-war\/battles\/antietam\",\"ogImage\":\"https:\/\/www.battlefields.org\/sites\/default\/files\/styles\/social_media\/public\/thumbnails\/image\/Antietam%20Battlefield%20Hero.jpg?h=26133ae9&itok=S05zXtkM\",\"ogLocaleAlternate\":[],\"ogSiteName\":\"American Battlefield Trust\",\"geo.position\":\"39.473125723648;-77.74491010581\",\"geo.region\":\"US-MD\",\"og:site_name\":\"American Battlefield Trust\",\"og:type\":\"website\",\"og:url\":\"https:\/\/www.battlefields.org\/learn\/civil-war\/battles\/antietam\",\"og:title\":\"Antietam\",\"og:description\":\"Battle of Antietam page - battle maps, history articles, photos, and preservation news on this important 1862 Civil War battle in Maryland.\",\"og:image\":\"https:\/\/www.battlefields.org\/sites\/default\/files\/styles\/social_media\/public\/thumbnails\/image\/Antietam%20Battlefield%20Hero.jpg?h=26133ae9&itok=S05zXtkM\",\"og:image:width\":\"857\",\"og:image:height\":\"450\",\"og:image:alt\":\"This is an image of the Antietam battlefield at sunset.\",\"place:location:latitude\":\"39.473125723648\",\"place:location:longitude\":\"-77.74491010581\",\"og:locality\":\"Sharpsburg\",\"og:region\":\"MD\",\"og:postal_code\":\"21782\",\"fb:pages\":\"21813808850\",\"twitter:card\":\"summary_large_image\",\"twitter:description\":\"Battle of Antietam page - battle maps, history articles, photos, and preservation news on this important 1862 Civil War battle in Maryland.\",\"twitter:site\":\"@battlefields\",\"twitter:title\":\"Antietam\",\"twitter:site:id\":\"25512685\",\"twitter:image:alt\":\"This is an image of the Antietam battlefield at sunset.\",\"viewport\":\"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no\",\"og:image:secure_url\":\"https:\/\/www.battlefields.org\/sites\/default\/files\/styles\/social_media\/public\/thumbnails\/image\/Antietam%20Battlefield%20Hero.jpg?h=26133ae9&itok=S05zXtkM\",\"twitter:image\":\"https:\/\/www.battlefields.org\/sites\/default\/files\/styles\/social_media\/public\/thumbnails\/image\/Antietam%20Battlefield%20Hero.jpg?h=26133ae9&itok=S05zXtkM\",\"sourceURL\":\"https:\/\/www.battlefields.org\/learn\/civil-war\/battles\/antietam\",\"statusCode\":200}}}" +} diff --git a/tests/Fixtures/Saloon/AgentChains/Rat/RatAgentChainFirecrawlTool-7b2933b3fa7351d076f3f06764a92c50.json b/tests/Fixtures/Saloon/AgentChains/Rat/RatAgentChainFirecrawlTool-7b2933b3fa7351d076f3f06764a92c50.json new file mode 100644 index 0000000..7275d40 --- /dev/null +++ b/tests/Fixtures/Saloon/AgentChains/Rat/RatAgentChainFirecrawlTool-7b2933b3fa7351d076f3f06764a92c50.json @@ -0,0 +1,8 @@ +{ + "statusCode": 200, + "headers": { + "X-Powered-By": "Express", + "Access-Control-Allow-Origin": "*" + }, + "data": "{\"success\":true,\"data\":{\"markdown\":\"* [Skip to global NPS navigation](#GlobalNav-toggle)\\n \\n* [Skip to this park navigation](#LocalNav-desktop-nav)\\n \\n* [Skip to the main content](#main)\\n \\n* [Skip to this park information section](#ParkFooter)\\n \\n* [Skip to the footer section](#GlobalFooter)\\n \\n\\n [![](https:\/\/www.nps.gov\/theme\/assets\/dist\/images\/branding\/logo.png) National Park Service](\/)\\n [Search](#GlobalFooterSearch)\\n\\nSearch\\n\\nThis Site All NPS\\n\\n \\n\\n* [Info](\/gett\/planyourvisit\/basicinfo.htm)\\n \\n* [Alerts 1](\/gett\/planyourvisit\/conditions.htm)\\n \\n* [Maps](\/gett\/planyourvisit\/maps.htm)\\n \\n* [Calendar](\/gett\/planyourvisit\/calendar.htm)\\n \\n* [Fees](\/gett\/planyourvisit\/fees.htm)\\n \\n\\n1 alert notifications\\n\\nAlerts In Effect\\n----------------\\n\\nDismiss\\n\\n### Park Closures\\n\\n* #### Rose Farm Rehabilitation Project Closure Notice\\n \\n Alert 1, Severity closure, Rose Farm Rehabilitation Project Closure Notice\\n \\n As of May 3, 2023, the Rose Farm & Rose Lane are closed to all visitation. The house will undergo a full rehabilitation. This work prohibits the use of the area around the house and lane during construction. Worker safety and resource protection are key.\\n \\n\\n[more information on current conditions...](\/gett\/planyourvisit\/conditions.htm)\\n\\nDismiss [View all alerts](\/gett\/planyourvisit\/conditions.htm)\\n\\nCivil War Timeline\\n==================\\n\\n ![Greyscale political cartoon from 1860 showing four men tearing apart a map of the United States.](https:\/\/www.nps.gov\/gett\/learn\/historyculture\/images\/1860-Election-Cartoon.jpg?maxwidth=1300&autorotate=false%20%221860%20Election%20Cartoon%22)\\n\\nA political cartoon from 1860 shows the four candidates, from left, Lincoln, Douglas, Breckenridge, and Bell tearing apart the United States.\\n\\nLibrary of Congress\\n\\n1860\\n----\\n\\n**November 6, 1860-** The American people elect Abraham Lincoln as sixteenth president of the United States. Lincoln is the first Republican president in the nation and represents a party that opposes the spread of slavery into the territories of the United States. \\n \\n**December 17, 1860-** The first state Secession Convention meets in Columbia, South Carolina. \\n \\n**December 20, 1860-** South Carolina secedes from the United States.\\n\\n ![Color illustration of cannons flying in arcs over the ocean to a stone fort.](https:\/\/www.nps.gov\/gett\/learn\/historyculture\/images\/Ft-Sumter_1.jpg?maxwidth=1300&autorotate=false%20%22Bombardment%20of%20Ft.%20Sumter%22)\\n\\nOn April l12, 1861 Confederates in South Carolina fired on Fort Sumter, starting the American Civil War.\\n\\nLibrary of Congress\\n\\n1861\\n----\\n\\n**January 1861-** Mississippi, Florida, Alabama, Georgia, Louisiana, and Texas secede from the United States. \\n \\n**February 4, 1861-** The southern states that had seceded assemble delegates at Montgomery, Alabama to organize the Confederate States of America. The delegates are tasked with drafting a Confederate Constitution and establishing a provisional government. \\n \\n**February 18, 1861-** The delegates at the Montgomery Convention appoint Jefferson Davis as provisional President of the Confederate States of America at Montgomery, Alabama, a position he will hold until elections can be arranged. \\n \\n**March 4, 1861-** Abraham Lincoln is inaugurated as the sixteenth president of the United States in Washington, DC. \\n \\n**March 11, 1861-** Confederate delegates in Montgomery approve the Constitution of the Confederate States of America. \\n \\n**April 12, 1861-** Confederate forces fire upon [Fort Sumter, South Carolina](https:\/\/www.nps.gov\/fosu)\\n. The Civil War formally begins. \\n \\n**April 15, 1861-** President Lincoln issues a public declaration that an insurrection exists and calls for 75,000 militia to stop the rebellion. As a result of this call for volunteers, Virginia, Arkansas, North Carolina, and Tennessee secede from the Union in the following weeks. Lincoln will respond on May 3 with an additional call for 43,000+ volunteers to serve for three years, expanding the size of the Regular Army. \\n \\n**May 24, 1861-** United States forces cross the Potomac River and occupy Arlington Heights, the home of future Confederate General Robert E. Lee. It is during the occupation of nearby Alexandria that Colonel Elmer Ellsworth, commander of the 11th New York Infantry and a close friend of the Lincolns, is shot dead by the owner of the Marshall House just after removing a Confederate flag from its roof. Ellsworth is the first US officer killed in the war. \\n \\n**Late May, 1861-** Richmond becomes the capitol of the Confederacy. Richmond was the Confederacy's second largest and most industrialized city. \\n \\n**June 3, 1861-** A skirmish near Philippi in western Virginia, is the first clash of United States and Confederate forces in the east. \\n \\n**June 10, 1861-** Battle of Big Bethel, the first land battle of the war in Virginia. \\n \\n**June 20, 1861-** At the culmination of the Wheeling Convention, the northwestern counties of Virginia broke away from that state to form West Virginia. West Virginia will be officially designated and accepted as the 35th state of the Union on June 20, 1863. \\n \\n**July 21, 1861-** The [Battle of Bull Run (or First Manassas),](https:\/\/www.nps.gov\/mana)\\n is fought near Manassas, Virginia. The Union Army under General Irwin McDowell initially succeeds in driving back Confederate forces under General Pierre Gustav Toutant Beauregard, but the arrival of troops under General Joseph E. Johnston initiates a series of reverses that sends McDowell's army in a panicked retreat to the defenses of Washington. \\n \\n**July 1861-** To thwart the Confederate threat in northern Virginia, a series of [earthworks and forts are engineered to surround the City of Washington](https:\/\/www.nps.gov\/cwdw)\\n, adding to protection already offered by active posts such as [Fort Washington](https:\/\/www.nps.gov\/fowa)\\n on the Potomac River. \\n \\n**August 6, 1861-** US Congress passes and President Lincoln signs the Confiscation Act of 1861. This act permits court proceedings for the confiscation of property, including enslaved people, used to support the Confederacy. \\n \\n**August 10, 1861-** At the [Battle of Wilson's Creek, Missouri](https:\/\/www.nps.gov\/wicr)\\n the United States Army under General Nathaniel Lyon attacks Confederate troops and state militia southwest of Springfield, Missouri. After a disastrous day that included the death of Lyon, Confederate forces repel the Federal attack. The defeat emphasizes to US leaders the strong Confederate presence west of the Mississippi River. \\n \\n**August 28-29, 1861-** Fort Hatteras at Cape Hatteras, North Carolina, falls to United States naval forces. This begins the first Federal efforts to close Southern ports along the Carolina coast. \\n \\n**September 20, 1861-** Lexington, Missouri falls to Confederate forces under Sterling Price. \\n \\n**October 21, 1861-** Battle of Ball's Bluff, Virginia. Colonel Edward D. Baker, senator from Oregon and a friend of President Lincoln, led troops across the Potomac River only to be forced back to the river's edge where he was killed. The ensuing Union withdrawal turned into a rout with many soldiers drowning while trying to re-cross the icy waters of the Potomac River. \\n \\n**November 1, 1861-** President Lincoln appoints General George B. McClellan as General-in-Chief of all United States armies.\\n\\n ![Historical black and white photograph of a group of Black people, including men on horses and a woman on a wagon pulled by oxen crossing a low river while watched by white US soldier.](https:\/\/www.nps.gov\/gett\/learn\/historyculture\/images\/Enslaved-People-Fording-Rappahanock.jpg?maxwidth=1300&autorotate=false%20%22Enslaved%20People%20Fording%20Rappahanock%22)\\n\\nIn the summer of 1862, enslaved people crossed into Federal lines seeking freedom. Over the course of the Civil War, US policy and war aims evolved, ultimately to include the abolition of slavery.\\n\\nLibrary of Congress\\n\\n1862\\n----\\n\\n**January 19, 1862-** Battle of Mill Springs, Kentucky. This Federal victory weakened the Confederate hold on the state. \\n \\n**February 6, 1862-** Surrender of Fort Henry, Tennessee. The loss of this southern fort on the Tennessee River opened the door to Federal control of the river. \\n \\n**February 8, 1862-** Battle of Roanoke Island, North Carolina. A Confederate defeat, the battle resulted in US occupation of eastern North Carolina and control of Pamlico Sound, to be used as Northern base for further operations against the southern coast. \\n \\n**February 16, 1862-** [Surrender of Fort Donelson, Tennessee](https:\/\/www.nps.gov\/fodo)\\n. This critical fort on the Cumberland River left the river in Federal control. It was here that US General Ulysses S. Grant gained his nickname \\\"Unconditional Surrender\\\" Grant. \\n \\n**February 22, 1862-** Jefferson Davis is inaugurated as President of the Confederate States of America. \\n \\n**March 7-8, 1862-** [Battle of Pea Ridge (Elkhorn Tavern), Arkansas.](https:\/\/www.nps.gov\/peri)\\n The US victory here loosened the Confederate hold on Missouri and disrupted southern control of a portion of the Mississippi River. \\n \\n**March 8-9, 1862-** The Battle of Hampton Roads pits USS Monitor and the CSS Virginia (the old USS Merrimack), the first ironclads, against one another off the Virginia coast. On March 8, the CSS Virginia destroys two wooden-hulled Federal ships. On March 9, the USS Monitor arrived and the two ironclads fought for hours, neither inflicting much damage on the other. \\n \\n**April 6-7, 1862-** [The Battle of Shiloh (Pittsburg Landing),](https:\/\/www.nps.gov\/shil)\\n the first major battle in Tennessee. Confederate General Albert Sidney Johnston, a veteran of the Texas War of Independence and the War with Mexico considered to be one of the finest officers in the Confederacy, is killed on the first day of fighting. The Federal victory further secures the career of US General Ulysses S. Grant. \\n \\n**April 24-25, 1862-** A Federal fleet of gunships under Admiral David Farragut passes Confederate forts guarding the mouth of the Mississippi River. On April 25, the fleet arrived at New Orleans where they demanded the surrender of the city. Within two days the forts fall to Federal forces and the mouth of the great river is under United States control. \\n \\n**May 25, 1862-** First Battle of Winchester, Virginia. After two weeks of maneuvering and battles at Cross Keys and Front Royal, Confederate General \\\"Stonewall\\\" Jackson attacks US forces at Winchester and successfully drives them from the city. The victory is the culmination of his 1862 Valley Campaign. \\n \\n**May 31-June 1, 1862-** [The Battle of Seven Pines near Richmond, Virginia.](https:\/\/www.nps.gov\/rich)\\n General Joseph Johnston, commander of the Confederate army in Virginia is wounded and replaced by Robert E. Lee who renames his command the \\\"Army of Northern Virginia\\\". \\n \\n**June 6, 1862-** Battle of Memphis, Tennessee. A US flotilla under Commodore Charles Davis successfully defeats a Confederate river force on the Mississippi River near the city and Memphis surrenders. The Mississippi River is now in Federal control except for its course west of Mississippi where the city of Vicksburg stands as the last Confederate stronghold on the great river. \\n \\n**June 25-July 1, 1862-** [The Seven Days' Battles before Richmond](https:\/\/www.nps.gov\/rich)\\n. General Lee's army attacks the US Army of the Potomac under General George McClellan in a succession of battles beginning at Mechanicsville on June 26 and ending at Malvern Hill on July 1. \\n \\n**July 17, 1862-** President Lincoln approves the Confiscation Act of 1862, or Second Confiscation Act. This act expands the terms of the previous Confiscation Act, allows broader seizure of Confederate property, the emancipation of enslaved people in Federally occupied territory, and prohibits the return of fugitive slaves. \\n \\n**August 30-31, 1862-** The [Battle of Second Bull Run (or Second Manassas)](https:\/\/www.nps.gov\/mana)\\n is fought on the same ground where one year before, the United States army was defeated and sent reeling in retreat to Washington. Likewise, the result of this battle is a US defeat. \\n \\n**September 17, 1862-** [The Battle of Antietam (or Sharpsburg), Maryland,](https:\/\/www.nps.gov\/anti)\\n the bloodiest single day of the Civil War. The result of the battle ends Confederate General Lee's first invasion of the North. \\n \\n**September 22, 1862-** Following the US victory at Antietam, President Lincoln introduces the Preliminary Emancipation Proclamation, which announced Lincoln's intention to declare all enslaved people free on January 1, 1863 if those places remained in rebellion at that time. \\n \\n**December 11-15, 1862-** [The Battle of Fredericksburg, Virginia](https:\/\/www.nps.gov\/frsp)\\n. The Confederate Army of Northern Virginia, under General Lee, wins a lopsided victory over the US Army of the Potomac, under General Ambrose Burnside, after Federal forces conducted a risky river crossing in an attempt to win a victory on Confederate soil before the release of Emancipation Proclamation. \\n \\n**December 24, 1862-** Jefferson Davis writes an order declaring US General Benjamin Butler to be an outlaw for his treatment of the civilians of New Orleans. Included in this proclamation is a statement that Lincoln's upcoming Emancipation Proclamation is designed to \\\"excite servile war\\\" and that any black US soldiers or their white officers are to be sent to the individual states instead of being treated as prisoners of war. \\n \\n**December 31-January 3, 1863-** [Battle of Stones River, Tennessee](https:\/\/www.nps.gov\/srnc)\\n. Fought between the US Army of the Cumberland under General William Rosecrans and the Confederate Army of Tennessee under General Braxton Bragg, the costly Federal victory frees middle Tennessee from Confederate control and boosts Northern morale.\\n\\n ![Historical black and white photograph of flat, open field with scattered dead bodies.](https:\/\/www.nps.gov\/gett\/learn\/historyculture\/images\/Gettysburg-Dead.jpg?maxwidth=1300&autorotate=false%20%22Gettysburg%20Dead%22)\\n\\nAs casualties mounted, battlefield photography displayed the awful spectacle of battle to an American public that had largely romanticized war at the beginning of the conflict.\\n\\nLibrary of Congress\\n\\n1863\\n----\\n\\n**January 1, 1863-** The Emancipation Proclamation goes into effect. The Emancipation Proclamation was a war measure that declared enslaved people in rebelling states to be free, authorized the enlistment of black troops, and outraged white Southerners. The proclamation was an important turning point in the war for the United States and in the eventual shift from the goal of restoring the Union as it was, to building a better Union without slavery. \\n \\n**March 3, 1863-** Conscription, or the drafting of soldiers into military service, begins in the North. It had begun in the Confederacy the year before. \\n \\n**April 1863-** Federal forces in the east begin a new campaign in Virginia to flank Lee's Army of Northern Virginia at Fredericksburg. In the west, a Federal army has begun a campaign to surround and take Vicksburg, Mississippi, the last Confederate stronghold on the Mississippi River. \\n \\n**April 30-May 6, 1863-** [Battle of Chancellorsville, Virginia.](https:\/\/www.nps.gov\/frsp)\\n US General Joseph Hooker's plan to flank Lee falls apart and Union forces retreat. Lee's victory at Chancellorsville is marred by high casualties, including the mortal wounding of \\\"Stonewall\\\" Jackson, who dies on May 10. Soon after, Lee asks Jefferson Davis for permission to invade the North and take the war out of Virginia. \\n \\n**May 1, 1863-** The Confederate Congress passes a Retaliatory Act in line Jefferson Davis' earlier proclamation and in response to the Emancipation Proclamation. The act establishes that the Confederacy considers the enlistment of black troops to be the equivalent of inciting a servile rebellion, white officers of black troops are to be executed, and black troops taken prisoner are to be sent to the states, where they could be executed or re-enslaved. \\n \\n**May 18, 1863-** [Siege of Vicksburg, Mississippi](https:\/\/www.nps.gov\/vick\/index.htm)\\n begins. US forces under General Ulysses S. Grant attack Confederate defenses outside the city on May 19-22. If Vicksburg falls, the Mississippi River will be completely controlled by the United States. \\n \\n**May 22, 1863-** The US War Department issues General Order No. 143 establishes the United States Colored Troops. \\n \\n**June 9, 1863-** Battle of Brandy Station, Virginia. US cavalry forces cross the Rapidan River to attack General J.E.B. Stuart's cavalry and discover that Lee's men are moving west toward the Shenandoah Valley. The largest cavalry battle of the Civil War, it also marks the beginning of the Gettysburg Campaign. Meanwhile, the Federal assault on [Vicksburg, Mississippi](https:\/\/www.nps.gov\/vick)\\n has become a siege of the city where soldiers and civilians alike suffer from constant bombardment. \\n \\n**June 14-15, 1863-** Battle of Second Winchester, Virginia. Confederate troops under General Richard Ewell defeat Union troops under General Robert Milroy, clearing the Shenandoah Valley of Federal forces. \\n \\n**June 28, 1863-** [The Gettysburg Campaign](https:\/\/www.nps.gov\/gett)\\n continues. Confederates pass through York and reach the bridge over the Susquehanna River at Columbia, but Federal militia set fire to the bridge, denying access to the east shore. Confederate cavalry skirmishes with Federal militia near Harrisburg, Pennsylvania. \\n \\n**July 1-3-** [Battle of Gettysburg, Pennsylvania.](https:\/\/www.nps.gov\/gett)\\n The bloodiest battle of the Civil War dashes Robert E. Lee's hopes for a successful invasion of the North. \\n \\n**July 4-** [Vicksburg, Mississippi,](https:\/\/www.nps.gov\/vick)\\n surrenders to the US Army under Grant. The capture of Vicksburg gives the Unites States complete control of the Mississippi River, a vital supply line for the Confederate states in the west. At Gettysburg, Lee begins his retreat to Virginia. \\n \\n**July 10-11, 1863-** US naval and land forces attack Confederate defenses near Charleston, South Carolina. Among the United States troops is the 54th Massachusetts Colored Infantry, the first African American regiment of volunteers to see combat in the Civil War. \\n \\n**July 13, 1863-** Draft Riots begin in New York City and elsewhere as disgruntled workers and laborers, seething over the draft system that seemingly favors the rich, attack the draft office and African American churches. The riots continue through July 16. \\n \\n**July 13-14, 1863-** Near Falling Waters, Maryland, US troops skirmish with Lee's rearguard. That night the Army of Northern Virginia crosses the Potomac River and the Gettysburg Campaign ends. \\n \\n**July 18, 1863-** Second Assault on Battery Wagner, South Carolina. Leading the US infantry charge is the 54th Massachusetts Colored Infantry commanded by Colonel Robert Gould Shaw who is killed and buried with the dead of his regiment. \\n \\n**July 30, 1863-** Lincoln issues General Order 252 in response to the Confederate refusal to treat black soldiers the same as white soldiers. General Order 252 declares that for any US prisoner killed in violation of the laws of war, a Confederate prisoner would be killed in exchange. The prisoner exchange system effectually suspended. \\n \\n**August 21, 1863-** Sacking of Lawrence, Kansas. In a murderous daylight raid, Confederate and Missouri guerillas under William Clarke Quantrill storm into Lawrence and destroy most of the town. Approximately 150 men and boys are murdered by Quantrill's men. \\n \\n**September 9, 1863-** Chattanooga, Tennessee, is occupied by Federal forces under General William Rosecrans whose Army of the Cumberland will soon invade northern Georgia. \\n \\n**September 19-20, 1863-** [The Battle of Chickamauga,](https:\/\/www.nps.gov\/chch)\\n Georgia. The US Army of the Cumberland under General William Rosecrans is defeated and nearly routed by the Confederate Army of Tennessee commanded by General Braxton Bragg. Rosecrans' army retreats to the supply base at Chattanooga, Tennessee. \\n \\n**September-November 1863-** [The Siege of Chattanooga, Tennessee](https:\/\/www.nps.gov\/chch)\\n. Confederate forces under Braxton Bragg surround the occupied city. General Ulysses S. Grant is assigned to command the troops there and begins immediate plans to relieve the besieged US Army. \\n \\n**October 5, 1863-** Outside of Charleston Harbor, the Confederate David, a partially submerged, steam powered vessel, attacked the New Ironsides, part of the US fleet blockading the harbor, with a torpedo. Both ships survived the attack, though the commander of the David and one of his crew were captured. \\n \\n**October 9 -22, 1863-** Bristoe Station Campaign. In a feint toward Washington, Lee's Army of the Northern Virginia marches into northern Virginia in an attempt to flank the Army of the Potomac, under General Meade. Lee successfully outmaneuvers Meade though fails to bring him to battle or catch him in the open. An engagement at Bristoe Station, Virginia, on October 14 gives the campaign its name. \\n \\n**November 19, 1863-** Dedication of the Soldiers' National Cemetery at Gettysburg. President Abraham Lincoln delivers the Gettysburg Address. \\n \\n**November 23-25, 1863-** [Battles for Chattanooga.](https:\/\/www.nps.gov\/chch)\\n US forces break the Confederate siege of the city in successive attacks. The most notable event is the storming of Lookout Mountain on November 24 and Battle of Missionary Ridge the following day. The decisive Federal victory sends the Confederate Army south into Georgia where General Bragg reorganizes his forces before resigning from command on November 30. \\n \\n**November 26-December 1, 1863**\\\\- The Mine Run Campaign. US General Meade's Army of the Potomac marches against Confederate General Lee's Army of Northern Virginia south of the Rapidan River, east of Orange Court House. Lee reacts and throws up a line of defenses along the banks of Mine Run Creek. After several days of probing the defenses, Meade withdraws north of the Rapidan and goes into winter quarters. \\n \\n**November 27 to December 3, 1863-** Siege of Knoxville, Tennessee. Confederate troops under General James Longstreet lay siege to the city of Knoxville held by Federal forces under General Ambrose Burnside. Longstreet finally attacks on November 30 but is repulsed with heavy losses. The arrival of US reinforcements forces him to withdraw to Greeneville, Tennessee, where his corps will spend the winter. \\n \\n**December 8, 1863-** Lincoln Issues his Proclamation of Amnesty and Reconstruction, which would pardon those who participated in the \\\"existing rebellion\\\" if they take an oath to the United States.\\n\\n ![Historical black and white photograph of US General Ulysses S. Grant, standing, with his military staff, all seated in front of a tent.](https:\/\/www.nps.gov\/gett\/learn\/historyculture\/images\/Grant-and-Staff_2.jpg?maxwidth=1300&autorotate=false%20%22Grant%20and%20Staff%20at%20Cold%20Harbor%22)\\n\\nWith the pressure of an election looming, in March of 1864, Lincoln appointed General Ulysses S. Grant to be commander of all the US armies. The war was far from decided and the fate of the Union was still uncertain.\\n\\nLibrary of Congress\\n\\n1864\\n----\\n\\n**February 9, 1864-** Escape from Libby Prison, Richmond. After weeks of digging, 109 United States officers made their escape from the notorious Libby Prison, the largest and most sensational escape of the war. Though 48 of the escapees were later captured and two drowned, 59 were able to make their way into US lines. \\n \\n**February 27, 1864-** In Georgia, Camp Sumter Prison Camp opens. Universally referred to as [Andersonville Prison Camp](https:\/\/www.nps.gov\/ande)\\n, it will become notorious for overcrowded conditions and a high death rate among its inmates. \\n \\n**February 14-20, 1864-** Federal capture and occupation of Meridian, Mississippi. Federal forces under William T. Sherman enter the city of Meridian, Mississippi after a successful month of campaigning through the central part of the state. The capture of this important Southern town, well known for its industry and storage capabilities, severely hampers the efforts of Confederate commanders to sustain their armies in the Deep South, Georgia and west of the Mississippi River. \\n \\n**February 17, 1864-** First successful submarine attack of the Civil War. The CSS H.L. Hunley, a seven-man submergible craft, attacked the USS Housatonic outside of Charleston, South Carolina. Struck by the submarine's torpedo, the Housatonic broke apart and sank, taking all but five of her crew with her. Likewise, the Hunley was also lost and never heard from again until discovered in 1995 at the spot where it sank after the attack. \\n \\n**March 2, 1864-** US General Ulysses S. Grant is appointed lieutenant general, a rank revived at the request of President Lincoln. Grant assumes command of all United States Armies in the field the following day. \\n \\n**March 10, 1864-** The Red River Campaign begins. As part of an overall Federal strategy to strike deep into various parts of the Confederacy, a combined force of army and navy commands under General Nathaniel Banks begins a campaign on the Red River in Louisiana. \\n \\n**April 8, 1864-** Battle of Sabine Crossroads or Mansfield, Louisiana, the first major battle of the Red River Campaign in Louisiana. \\n \\n**April 9, 1864-** Battle of Pleasant Hill, Louisiana. The United States Army under Banks defeats the attempt by Confederate forces under General Richard Taylor to drive them out of Louisiana. The result of the campaign would be less than desired as it drew to a close in the first week of May with Confederates still in control of most of the state. \\n \\n**April 12, 1864-** Capture of Fort Pillow, Tennessee. After a rapid raid through central and western Tennessee, Confederate cavalry under Nathan Bedford Forrest attacked and overwhelmed the Federal garrison at Fort Pillow, located on the Mississippi River. Forrest's troops murdered nearly 300 United States soldiers after they had surrendered, most of whom were African American. Congress investigated the affair and while Confederate authorities denied any wrongdoing, the events at Fort Pillow cast a pall over Forrest's reputation and remained an emotional issue throughout the remainder of the war and after. \\n \\n**April 17, 1864-** Grant forbids prisoner exchange talks to progress unless Confederate authorities agree to treat black soldiers the same as white and until Confederates release enough US soldiers to make up for the large number of Confederates paroled at Vicksburg and Port Hudson. \\n \\n**May 5-6, 1864-** [Battle of the Wilderness, Virginia](https:\/\/www.nps.gov\/frsp)\\n, the opening battle of the Overland Campaign. US General Ulysses S. Grant, accompanying the Army of the Potomac under General Meade, issued orders for the campaign to begin on May 3. Lee responded by attacking the Federal column in the dense woods and underbrush of an area known as the Wilderness, west of Fredericksburg, Virginia. \\n \\n**May 7, 1864-** Beginning of the Atlanta Campaign. With three US Armies under his command, General William T. Sherman marched south from Tennessee into Georgia against the Confederate Army of Tennessee under General Joseph Johnston, the objective being the city of Atlanta. \\n \\n**May 8-21, 1864-** [Battle of Spotsylvania Court House, Virginia](https:\/\/www.nps.gov\/frsp)\\n. Lee successfully stalls Grant's drive toward Richmond. \\n \\n**May 11, 1864-** Battle of Yellow Tavern. Six miles north of Richmond, Confederate cavalry under General J.E.B. Stuart block Federal cavalry under General Philip Sheridan. General Stuart was mortally wounded during the encounter. \\n \\n**May 14-15, 1864-** Battle of Resaca, Georgia. General Sherman's armies are blocked at Resaca by General Johnston's Army of Tennessee. After two days of maneuvering and intense fighting, Johnston withdraws. Sherman will advance but take precautions against ordering any further massed assaults where high casualties may occur. \\n \\n**June 1-3, 1864-** [Battle of Cold Harbor, Virginia](https:\/\/www.nps.gov\/rich)\\n. Relentless and bloody US attacks fail to dislodge Lee's army from its strong line of defensive works northeast of Richmond. \\n \\n**June 8, 1864-** Abraham Lincoln is nominated for a second term as president. \\n \\n**June 10, 1864-** [Battle of Brice's Crossroads, Mississippi](https:\/\/www.nps.gov\/brcr)\\n\\\\- In spite of being outnumbered almost two to one, Confederate General Nathan Bedford Forrest attacks and routs the Federal command under General Samuel Sturgis. \\n \\n**June 15-18, 1864-** [Assault on Petersburg, Virginia](https:\/\/www.nps.gov\/pete)\\n. After withdrawing from the lines at Cold Harbor, the Army of the Potomac crossed the James River and with troops from the Army of the James attacked the outer defenses of Petersburg, the primary junction for several southern railroads. After four days of bloody attacks, Grant accepts that only a siege can systematically isolate the city and cut off Confederate supplies to the capital of Richmond. \\n \\n**June 19, 1864-** The USS Kearsarge sinks the Confederate raider CSS Alabama near Cherbourg, France. \\n \\n**June 27, 1864-** [Battle of Kennesaw Mountain, Georgia](https:\/\/www.nps.gov\/kemo)\\n. After weeks of maneuvering and battles, Sherman's Army of the Cumberland and Army of the Tennessee smash headlong into Johnston's carefully planned defenses at Big and Little Kennesaw. Johnston remains on this line until July 2, when he retreats at the threat being flanked by Sherman's mobile force. \\n \\n**July 9, 1864-** [Battle of Monocacy, Maryland](https:\/\/www.nps.gov\/mono)\\n. In an attempt to draw Federal troops away from the ongoing siege of Petersburg and Richmond, a Confederate force under Jubal Early quietly moved north into Maryland. Early had made excellent progress until he reached Frederick, Maryland, where a force of 6,000 Federal troops under General Lew Wallace, was arrayed to delay his advance. Though the battle was a US defeat, it was also touted as \\\"the battle that saved Washington\\\" for it succeeded in holding back Early's march until troops could be sent to the capital's defense. \\n \\n**July 11-12, 1864-** Attack on the Defenses of Washington. Jubal Early's troops arrive on the outskirts of Washington, DC, and trade cannon fire with a token Federal force remaining in the forts around the city. President Lincoln observes the skirmishing from Fort Stevens as reinforcements from the Army of the Potomac arrive and quickly fill in the works. Early withdraws that evening. \\n \\n**July 14-15, 1864-** [Battles near Tupelo, Mississippi.](https:\/\/www.nps.gov\/tupe)\\n The US defeat of Nathan Bedford Forrest secured the supply lines to Sherman's armies operating against Atlanta, Georgia. \\n \\n**July 17, 1864-** General John Bell Hood replaces General Joseph Johnston as commander of the Army of Tennessee. This change in command signals a new Confederate strategy to thwart Sherman's campaign, though the end result will be disastrous for the Confederate cause. \\n \\n**July 20, 1864-** Battle of Peachtree Creek, Georgia, the first major battle around the city of Atlanta. General Hood sends his army out of the city's defenses to attack the approaching Federal troops under George Thomas. After several hours of fierce fighting, Hood withdrew back to his own defensive works. \\n \\n**July 21, 1864-** The Battle of Atlanta. Hood's second effort to throw back Federal forces under Sherman brings him heavy casualties with no positive results. General James McPherson, commander of the US Army of the Tennessee, is killed during the fighting. \\n \\n**July 30, 1864-** The [Battle of the Crater at Petersburg, Virginia](https:\/\/www.nps.gov\/pete)\\n. After a month of tunneling by soldiers of the 48th Pennsylvania Infantry, a Federal forces explode a massive mine under a Confederate fort in the Petersburg siege lines. The infantry charge that followed was poorly coordinated and by day's end, Confederate counterattacks had driven out the US troops and the siege lines remained unchanged. \\n \\n**August 5, 1864-** Battle of Mobile Bay. A US fleet under Admiral David Farragut steamed into Mobile Bay outside the city of Mobile, Alabama, defended by two strong forts and a small southern flotilla, including the formidable ironclad CSS Tennessee. Farragut's ships defeated the Confederate ships and bypassed the forts, capturing the important Southern port. \\n \\n**August 18-19, 1864-** Battles on the Weldon Railroad near Petersburg, Virginia. US attempts to capture this important railroad into Petersburg were stopped by Confederate counterattacks. Despite Confederate efforts, the US remained in firm possession of their gains and the railroad. \\n \\n**August 25, 1864-** Battle of Ream's Station, near Petersburg, Virginia. A surprise Confederate counterattack briefly stopped Federal destruction of the Weldon Railroad near Ream's Station, though failed to release the Federal grip on this important supply line into Petersburg. \\n \\n**August 31- September 1, 1864-** Battle of Jonesborough, Georgia. The final Confederate counterattack against United States troops outside the city of Atlanta fails. \\n \\n**September 1, 1864-** Fall of Atlanta, Georgia. Confederate troops under General Hood evacuate the city of Atlanta. General Sherman's army occupies the city and its defenses the following day. \\n \\n**September 19, 1864-** Third Battle of Winchester, Virginia. US forces under General Philip Sheridan attacked the Confederate army under Jubal Early near the city of Winchester and drove them southward, up the Shenandoah Valley. \\n \\n**September 22, 1864-** Battle of Fisher's Hill, Virginia. The US Army of the Shenandoah under General Philip Sheridan attacked Jubal Early's Confederates near Fisher's Hill, overpowering the Confederates and again forcing them to flee the battlefield. United States officers and officials in Washington believe this to be the final battle in the Shenandoah Valley. \\n \\n**September 29-30, 1864-** Battle of Fort Harrison near Richmond, Virginia. In a sweeping assault, the Confederate stronghold known as Fort Harrison falls to the Army of the James. Confederate efforts to retake the fort fail. \\n \\n**October 19, 1864-** [The Battle of Cedar Creek, Virginia](https:\/\/www.nps.gov\/cebe)\\n. In an early morning surprise attack, Jubal Early's Confederates successfully attack and drive troops of the Army of the Shenandoah from their camps on the banks of Cedar Creek south of Middletown, Virginia. Hearing the fight from his headquarters at Winchester, General Philip Sheridan rides southward, rallying dispirited troops who return to the battlefield. By day's end, Early's forces are put to flight. Despite several attempts to disrupt the US advance in the coming weeks, the struggle for control of the Shenandoah Valley is over. \\n \\n**November 8, 1864-** Abraham Lincoln is reelected president of the United States. \\n \\n**November 16, 1864-** General Sherman's Army of Georgia begins the March to the Sea. \\n \\n**November 30, 1864-** Battle of Franklin, Tennessee. After a month of raiding Sherman's supply lines and attacking Federal outposts, John Bell Hood's army confronts US troops from General John Schofield's command, who they had encountered the day before near Spring Hill, Tennessee. A massive frontal assault on the well entrenched Federal line meets with disaster. Despite some taking of outside works and defenses, the toll for Hood's forces is too heavy including the loss of six of his generals. US troops retreat in the direction of Nashville. \\n \\n**December 10, 1864-** Harassed only by scattered Georgia militia, Sherman's Army of Georgia arrives at Savannah, Georgia, completing the famous March to the Sea. At Savannah, his troops will take Fort McAllister and force Confederate defenders to evacuate the city. \\n \\n**December 15-16, 1864-** The Battle of Nashville, Tennessee. The Confederate Army under John Bell Hood is thoroughly defeated and the threat to Tennessee ends.\\n\\n ![Colored illustration of orderly lines of United States soldiers, on foot and on horseback passing a crown with American flags lining the walkways.](https:\/\/www.nps.gov\/gett\/learn\/historyculture\/images\/Grand-review.jpg?maxwidth=1300&autorotate=false%20%22The%20Grand%20Review%20at%20Washington%20May%2023,%201865.%20The%20Glorious%20Army%20of%20the%20Potomac%20Passing%20the%20Head%20Stand%22)\\n\\nThe Grand Review in May 1865 celebrated the United States victory on the Civil War and the reunification of the nation. The future of the new United States, especially in the wake of the assassination of President Abraham Lincoln, was anything but clear.\\n\\nLibrary of Congress\\n\\n1865\\n----\\n\\n**January 15, 1865-** Assault and capture of Fort Fisher, North Carolina. United States occupation of this fort at the mouth of the Cape Fear River closes access to Wilmington, the last Southern seaport on the east coast that was open to blockade runners and commercial shipping. \\n \\n**February 1, 1865-** Sherman's Army leaves Savannah to march through the Carolinas. \\n \\n**February 17, 1865-** Sherman's Army captures Columbia, South Carolina while Confederate defenders evacuate Charleston, South Carolina. \\n \\n**February 22, 1865-** Wilmington, NC, falls to Federal troops, closing the last important Southern port on the east coast. On this same day, Joseph E. Johnston is restored to command the nearly shattered Army of the Tennessee, vice John B. Hood who resigned a month earlier. \\n \\n**March 4, 1865-** President Abraham Lincoln is inaugurated for his second term as president in Washington, DC. \\n \\n**March 11, 1865-** Sherman's Army occupies Fayetteville, North Carolina. \\n \\n**March 16 and 19-21, 1865-** The Battles of Averasborough and Bentonville, North Carolina. Sherman's army is stalled in its drive northward from Fayetteville but succeeds in passing around the Confederate forces toward its object of Raleigh. \\n \\n**March 25, 1865-** [Attack on Fort Stedman, Petersburg,](https:\/\/www.nps.gov\/pete)\\n Virginia. Touted as \\\"Lee's last offensive,\\\" Confederate troops under General John B. Gordon attack and briefly capture the Federal fort in the Petersburg siege lines in an attempt to thwart US plans for a late March assault. By day's end, the Confederates will be thrown out and the lines remain unchanged. \\n \\n**April 1, 1865-** [The Battle of Five Forks, Virginia](https:\/\/www.nps.gov\/pete)\\n. The Confederate defeat at Five Forks initiates General Lee's decision to abandon the Petersburg-Richmond siege lines. \\n \\n**April 2, 1865-** The Fall of Petersburg and [Richmond](https:\/\/www.nps.gov\/rich)\\n. General Lee abandons both cities and moves his army west in hopes of joining Confederate forces under General Johnston in North Carolina. \\n \\n**April 3, 1865-** US troops occupy Richmond and Petersburg, Virginia. \\n \\n**April 6, 1865-** The Battle of Sailor's Creek, Virginia. A portion of Lee's Army, almost one-third of it, is cornered along the banks of Sailor's (or \\\"Saylor's\\\") Creek and annihilated. \\n \\n**April 9, 1865-** [Battle of Appomattox Court House and Surrender, Appomattox Court House, Virginia.](https:\/\/www.nps.gov\/apco)\\n After an early morning attempt to break through Federal forces blocking the route west to Danville, Virginia, Lee seeks an audience with General Grant to discuss terms. That afternoon in the parlor of Wilmer McLean, Lee signs the document of surrender. On April 12, the Army of Northern Virginia formally surrenders and is disbanded. \\n \\n**April 14, 1865-** President Abraham Lincoln is assassinated by actor John Wilkes Booth at [Ford's Theater](https:\/\/www.nps.gov\/foth)\\n in Washington, DC. On the same day, Fort Sumter, South Carolina is re-occupied by US troops. \\n \\n**April 15, 1865-** Vice President Andrew Johnson is sworn in as 17th President of the United States. \\n \\n**April 26, 1865-** General Joseph Johnston signs the surrender document for the Confederate Army of the Tennessee and miscellaneous Confederate troops attached to his command at Bennett's Place near Durham, North Carolina. \\n \\n**May 4, 1865-** General Richard Taylor surrenders Confederate forces in the Department of Alabama, Mississippi and East Louisiana. \\n \\n**May 10, 1865-** Confederate President Jefferson Davis is captured near Irwinville, Georgia. \\n \\n**May 12, 1865-** The final battle of the Civil War takes place at Palmito Ranch, Texas. It is a Confederate victory. \\n \\n**May 23, 1865-** The Grand Review of the Army of the Potomac in Washington, DC. \\n \\n**May 24, 1865-** The Grand Review of General Sherman's Army in Washington, DC. \\n \\n**May 26, 1865-** General Simon Bolivar Buckner agrees to terms of surrender of the Army of the Trans-Mississippi, which are agreed to on June 2, 1865. With this surrender of the last large Confederate army, the Civil War officially ends. (Confederate Brigadier General Stand Waite did not surrender until June 23, and one Confederate ship, the CSS Shenandoah, docked in Liverpool and surrendered to the Royal Navy on November 6, 1865.)\\n\\nLast updated: October 6, 2022\\n\\n### Success\\n\\nThank you. Your feedback has been received.\\n\\n### Error\\n\\nalert message\\n\\nWas this page helpful?\\n----------------------\\n\\n Yes\\n\\n No\\n\\nHow could we improve this page? 500 characters allowed\\n\\nSubmit\\n\\nPark footer\\n-----------\\n\\n### Contact Info\\n\\n#### Mailing Address:\\n\\n1195 Baltimore Pike \\nGettysburg, PA 17325\\n\\n#### [Contact Us](\/gett\/contacts.htm)\\n\\n### Tools\\n\\n* [Site Index](\/gett\/siteindex.htm)\\n \\n* [Espa\u00f1ol](\/gett\/espanol\/index.htm)\\n \\n\\n### Stay Connected\\n\\n* [Facebook](http:\/\/www.facebook.com\/GettysburgNPS)\\n \\n* [Twitter](http:\/\/twitter.com\/gettysburgnmp)\\n \\n* [Instagram](http:\/\/www.instagram.com\/gettysburgnps)\\n \\n* [YouTube](http:\/\/www.youtube.com\/GettysburgNPS)\\n \\n\\n \\n\\npreviousnextstart slideshow\",\"metadata\":{\"title\":\"Civil War Timeline - Gettysburg National Military Park (U.S. National Park Service)\",\"description\":\"A time line of the American Civil War\",\"language\":\"en\",\"ogTitle\":\"Civil War Timeline - Gettysburg National Military Park (U.S. National Park Service)\",\"ogDescription\":\"A time line of the American Civil War\",\"ogUrl\":\"https:\/\/www.nps.gov\/gett\/learn\/historyculture\/civil-war-timeline.htm\",\"ogImage\":\"https:\/\/www.nps.gov\/gett\/learn\/historyculture\/images\/1860-Election-Cartoon.jpg\",\"ogLocaleAlternate\":[],\"viewport\":\"width=device-width, initial-scale=1.0\",\"apple-itunes-app\":\"app-id=1549226484, app-argument=https:\/\/apps.apple.com\/us\/app\/national-park-service\/id1549226484\",\"og:type\":\"website\",\"og:title\":\"Civil War Timeline - Gettysburg National Military Park (U.S. National Park Service)\",\"og:url\":\"https:\/\/www.nps.gov\/gett\/learn\/historyculture\/civil-war-timeline.htm\",\"og:description\":\"A time line of the American Civil War\",\"og:image\":[\"https:\/\/www.nps.gov\/gett\/learn\/historyculture\/images\/1860-Election-Cartoon.jpg\",\"https:\/\/www.nps.gov\/gett\/learn\/historyculture\/images\/Ft-Sumter_1.jpg\",\"https:\/\/www.nps.gov\/gett\/learn\/historyculture\/images\/Enslaved-People-Fording-Rappahanock.jpg\",\"https:\/\/www.nps.gov\/gett\/learn\/historyculture\/images\/Gettysburg-Dead.jpg\",\"https:\/\/www.nps.gov\/gett\/learn\/historyculture\/images\/Grant-and-Staff_2.jpg\",\"https:\/\/www.nps.gov\/gett\/learn\/historyculture\/images\/Grand-review.jpg\"],\"og:image:height\":[\"2000\",\"2500\",\"2211\",\"2026\",\"2500\",\"2500\"],\"og:image:width\":[\"2928\",\"3814\",\"3384\",\"3300\",\"3846\",\"3849\"],\"og:image:alt\":[\"Greyscale political cartoon from 1860 showing four men tearing apart a map of the United States.\",\"Color illustration of cannons flying in arcs over the ocean to a stone fort.\",\"Historical black and white photograph of a group of Black people, including men on horses and a woman on a wagon pulled by oxen crossing a low river while watched by white US soldier.\",\"Historical black and white photograph of flat, open field with scattered dead bodies.\",\"Historical black and white photograph of US General Ulysses S. Grant, standing, with his military staff, all seated in front of a tent.\",\"Colored illustration of orderly lines of United States soldiers, on foot and on horseback passing a crown with American flags lining the walkways.\"],\"sourceURL\":\"https:\/\/www.nps.gov\/gett\/learn\/historyculture\/civil-war-timeline.htm\",\"statusCode\":200}}}" +} diff --git a/tests/Fixtures/Saloon/AgentChains/Rat/RatAgentChainFirecrawlTool-a08c0ae23dd3be2864787728bf4e74c4.json b/tests/Fixtures/Saloon/AgentChains/Rat/RatAgentChainFirecrawlTool-a08c0ae23dd3be2864787728bf4e74c4.json new file mode 100644 index 0000000..6285b6a --- /dev/null +++ b/tests/Fixtures/Saloon/AgentChains/Rat/RatAgentChainFirecrawlTool-a08c0ae23dd3be2864787728bf4e74c4.json @@ -0,0 +1,8 @@ +{ + "statusCode": 200, + "headers": { + "X-Powered-By": "Express", + "Access-Control-Allow-Origin": "*" + }, + "data": "{\"success\":true,\"data\":{\"markdown\":\"Your Profile\\n\\n[![](https:\/\/www.history.com\/assets\/images\/history\/logo.svg)History](\/)\\n\\n* [Find History on Facebook (Opens in a new window)](https:\/\/www.facebook.com\/History)\\n \\n* [Find History on Twitter (Opens in a new window)](https:\/\/twitter.com\/history)\\n \\n* [Find History on YouTube (Opens in a new window)](https:\/\/www.youtube.com\/subscription_center?add_user=historychannel)\\n \\n* [Find History on Instagram (Opens in a new window)](http:\/\/instagram.com\/history)\\n \\n* [Find History on TikTok (Opens in a new window)](https:\/\/www.tiktok.com\/@history)\\n \\n\\n[Email Updates](\/emails\/sign-up)\\n\\n* [Live TV](https:\/\/play.history.com\/live)\\n \\n* [History Classics](https:\/\/play.history.com\/channel\/ancient-aliens-fan-favorites)\\n \\n* [Shows](https:\/\/www.history.com\/shows)\\n \\n* [This Day In History](https:\/\/www.history.com\/this-day-in-history)\\n \\n* [Schedule](https:\/\/www.history.com\/schedule)\\n \\n* [Topics](https:\/\/www.history.com\/topics)\\n \\n* [Stories](https:\/\/www.history.com\/news)\\n \\n* [Videos](https:\/\/www.history.com\/videos)\\n \\n* [History Podcasts](https:\/\/www.history.com\/podcasts)\\n \\n* [History Vault](https:\/\/www.historyvault.com\/?cmpid=HV_O_Site_H_Menu)\\n \\n\\n![](https:\/\/www.history.com\/editorial\/_next\/image?url=https%3A%2F%2Fassets.editorial.aetnd.com%2Fuploads%2F2012%2F05%2Fthis-day-in-history-11-19-1863-lincoln-gettysburg-address.jpg&w=3840&q=75)\\n\\n[1863](\/this-day-in-history\/year\/1863)\\n\\nPresident Lincoln delivers Gettysburg Address\\n=============================================\\n\\nThis Day In History: 11\/19\/1863 - Lincoln Gettysburg Address\\n\\nPlay Video\\n\\nLearn more\\n\\nRelated contentRelated contentShare VideoShare Video\\n\\nPlaying on\\n\\nSubtitles\\n\\nLanguage\\n\\nSettings\\n\\n* QualityAutomatic Automatic HD\\n* SpeedNormal\\n* SubtitleOptions\\n\\nQuality\\n\\n* Automatic\\n\\nSpeed\\n\\n* 0.25\\n* 0.5\\n* Normal\\n* 1.25\\n* 1.5\\n* 2\\n\\nSubtitle Options\\n\\n* Font familyDefault\\n* Font colorDefault\\n* Font opacityDefault\\n* Font sizeDefault\\n* Background colorDefault\\n* Background opacityDefault\\n* Window colorDefault\\n* Window opacityDefault\\n* Character edge styleDefault\\n\\nFont family\\n\\n* Default\\n* Monospaced Serif\\n* Proportional Serif\\n* Monospaced Sans-Serif\\n* Proportional Sans-Serif\\n\\nFont color\\n\\n* Default\\n* White\\n* Yellow\\n* Green\\n* Cyan\\n* Blue\\n* Magenta\\n* Red\\n* Black\\n\\nFont opacity\\n\\n* Default\\n* 25%\\n* 50%\\n* 75%\\n* 100%\\n\\nFont size\\n\\n* Default\\n* 50%\\n* 75%\\n* 100%\\n* 150%\\n* 200%\\n\\nBackground color\\n\\n* Default\\n* White\\n* Yellow\\n* Green\\n* Cyan\\n* Blue\\n* Magenta\\n* Red\\n* Black\\n\\nBackground opacity\\n\\n* Default\\n* 0%\\n* 25%\\n* 50%\\n* 75%\\n* 100%\\n\\nWindow color\\n\\n* Default\\n* White\\n* Yellow\\n* Green\\n* Cyan\\n* Blue\\n* Magenta\\n* Red\\n* Black\\n\\nWindow opacity\\n\\n* Default\\n* 0%\\n* 25%\\n* 50%\\n* 75%\\n* 100%\\n\\nCharacter edge style\\n\\n* Default\\n* None\\n* Drop Shadow\\n* Raised\\n* Depressed\\n* Uniform\\n\\nLoaded: 0%\\n\\n0:00\\n\\nProgress: 0%\\n\\n0:00\\n\\nProgress: 0%\\n\\nPlayPlayUnmuteUnmute\\n\\nCurrent Time 0:00\\n\\n\/\\n\\nDuration Time 0:00\\n\\nLive\\n\\nRemaining Time -0:00\\n\\nWatch in VRWatch in VR\\n\\n* , selecteddescriptions off\\n\\nDescriptions\\n\\nSubtitlesSubtitlesUnavailable\\n\\nUnavailableUnavailable\\n\\nUnavailableLanguageLanguageSettingsHDSettingsFullscreenFullscreen\\n\\nThis is a modal window.\\n\\nCaption Settings Dialog\\n\\nBeginning of dialog window. Escape will cancel and close the window.\\n\\nTextColorWhiteBlackRedGreenBlueYellowMagentaCyanTransparencyOpaqueSemi-Transparent\\n\\nBackgroundColorBlackWhiteRedGreenBlueYellowMagentaCyanTransparencyOpaqueSemi-TransparentTransparent\\n\\nWindowColorBlackWhiteRedGreenBlueYellowMagentaCyanTransparencyTransparentSemi-TransparentOpaque\\n\\nFont Size50%75%100%125%150%175%200%300%400%\\n\\nText Edge StyleNoneRaisedDepressedUniformDropshadow\\n\\nFont FamilyProportional Sans-SerifMonospace Sans-SerifProportional SerifMonospace SerifCasualScriptSmall Caps\\n\\nDefaultsDone\\n\\n* [Powered by THEOplayer 7.5.0](https:\/\/www.theoplayer.com\/player-referral)\\n \\n\\nClose Related Content\\n\\nClose Share\\n\\nOn November 19, 1863, at the dedication of a military cemetery at Gettysburg, [Pennsylvania](\/topics\/us-states\/pennsylvania)\\n, during the [American](\/topics\/american-civil-war)\\n [Civil War](\/topics\/american-civil-war\/american-civil-war-history)\\n, President [Abraham Lincoln](\/topics\/us-presidents\/abraham-lincoln)\\n delivers one of the most memorable speeches in American history. In fewer than 275 words, Lincoln brilliantly and movingly reminded a war-weary public why the Union had to fight, and win, the Civil War.\\n\\nThe [Battle of Gettysburg](\/topics\/american-civil-war\/battle-of-gettysburg)\\n, fought some four months earlier, was one of the single bloodiest battle of the Civil War. Over the course of three days, more than 45,000 men were killed, injured, captured or went missing. The battle also proved to be the turning point of the war: General Robert E. Lee\u2019s defeat and retreat from Gettysburg marked the last Confederate invasion of Northern territory and the beginning of the Southern army\u2019s ultimate decline.\\n\\nPlay Video\\n\\nLearn more\\n\\nRelated contentRelated contentShare VideoShare Video\\n\\nPlaying on\\n\\nSubtitles\\n\\nLanguage\\n\\nSettings\\n\\n* QualityAutomatic Automatic HD\\n* SpeedNormal\\n* SubtitleOptions\\n\\nQuality\\n\\n* Automatic\\n\\nSpeed\\n\\n* 0.25\\n* 0.5\\n* Normal\\n* 1.25\\n* 1.5\\n* 2\\n\\nSubtitle Options\\n\\n* Font familyDefault\\n* Font colorDefault\\n* Font opacityDefault\\n* Font sizeDefault\\n* Background colorDefault\\n* Background opacityDefault\\n* Window colorDefault\\n* Window opacityDefault\\n* Character edge styleDefault\\n\\nFont family\\n\\n* Default\\n* Monospaced Serif\\n* Proportional Serif\\n* Monospaced Sans-Serif\\n* Proportional Sans-Serif\\n\\nFont color\\n\\n* Default\\n* White\\n* Yellow\\n* Green\\n* Cyan\\n* Blue\\n* Magenta\\n* Red\\n* Black\\n\\nFont opacity\\n\\n* Default\\n* 25%\\n* 50%\\n* 75%\\n* 100%\\n\\nFont size\\n\\n* Default\\n* 50%\\n* 75%\\n* 100%\\n* 150%\\n* 200%\\n\\nBackground color\\n\\n* Default\\n* White\\n* Yellow\\n* Green\\n* Cyan\\n* Blue\\n* Magenta\\n* Red\\n* Black\\n\\nBackground opacity\\n\\n* Default\\n* 0%\\n* 25%\\n* 50%\\n* 75%\\n* 100%\\n\\nWindow color\\n\\n* Default\\n* White\\n* Yellow\\n* Green\\n* Cyan\\n* Blue\\n* Magenta\\n* Red\\n* Black\\n\\nWindow opacity\\n\\n* Default\\n* 0%\\n* 25%\\n* 50%\\n* 75%\\n* 100%\\n\\nCharacter edge style\\n\\n* Default\\n* None\\n* Drop Shadow\\n* Raised\\n* Depressed\\n* Uniform\\n\\nLoaded: 0%\\n\\n0:00\\n\\nProgress: 0%\\n\\n0:00\\n\\nProgress: 0%\\n\\nPausePauseUnmuteUnmute\\n\\nCurrent Time 0:00\\n\\n\/\\n\\nDuration Time 0:00\\n\\nLive\\n\\nRemaining Time -0:00\\n\\nWatch in VRWatch in VR\\n\\n* , selecteddescriptions off\\n\\nDescriptions\\n\\nSubtitlesSubtitlesUnavailable\\n\\nUnavailableUnavailable\\n\\nUnavailableLanguageLanguageSettingsHDSettingsFullscreenFullscreen\\n\\nThis is a modal window.\\n\\nCaption Settings Dialog\\n\\nBeginning of dialog window. Escape will cancel and close the window.\\n\\nTextColorWhiteBlackRedGreenBlueYellowMagentaCyanTransparencyOpaqueSemi-Transparent\\n\\nBackgroundColorBlackWhiteRedGreenBlueYellowMagentaCyanTransparencyOpaqueSemi-TransparentTransparent\\n\\nWindowColorBlackWhiteRedGreenBlueYellowMagentaCyanTransparencyTransparentSemi-TransparentOpaque\\n\\nFont Size50%75%100%125%150%175%200%300%400%\\n\\nText Edge StyleNoneRaisedDepressedUniformDropshadow\\n\\nFont FamilyProportional Sans-SerifMonospace Sans-SerifProportional SerifMonospace SerifCasualScriptSmall Caps\\n\\nDefaultsDone\\n\\n* [Powered by THEOplayer 7.5.0](https:\/\/www.theoplayer.com\/player-referral)\\n \\n\\nThe Gettysburg Address\\n\\nClose Related Content\\n\\nClose Share\\n\\nCharged by Pennsylvania\u2019s governor, Andrew Curtin, to care for the Gettysburg dead, an attorney named David Wills bought 17 acres of pasture to turn into a cemetery for the more than 7,500 who fell in battle. Wills invited Edward Everett, one of the most famous orators of the day, to deliver a speech at the cemetery\u2019s dedication. Almost as an afterthought, Wills also sent a letter to Lincoln\u2014just two weeks before the ceremony\u2014requesting \u201ca few appropriate remarks\u201d to consecrate the grounds.\\n\\nAt the dedication, the crowd listened for two hours to Everett before Lincoln spoke. Lincoln\u2019s address lasted just two or three minutes. The speech reflected his redefined belief that the Civil War was not just a fight to save the Union, but a struggle for freedom and equality for all, an idea Lincoln had not championed in the years leading up to the war.\\n\\nThis was his stirring conclusion: \u201cThe world will little note, nor long remember what we say here, but it can never forget what they did here. It is for us the living, rather, to be dedicated here to the unfinished work which they who fought here have thus far so nobly advanced. It is rather for us to be here dedicated to the great task remaining before us\u2014that from these honored dead we take increased devotion to that cause for which they gave the last full measure of devotion\u2014that we here highly resolve that these dead shall not have died in vain\u2014that this nation, under God, shall have a new birth of freedom\u2014and that government of the people, by the people, for the people, shall not perish from the earth.\u201d\\n\\nReception of Lincoln\u2019s Gettysburg Address was initially mixed, divided strictly along partisan lines. Nevertheless, the \u201clittle speech,\u201d as he later called it, is thought by many today to be the most eloquent articulation of the democratic vision ever written.\\n\\n[![Battle of Gettysburg](https:\/\/assets.editorial.aetnd.com\/uploads\/2019\/07\/battle-of-gettysburg-gettyimages-3090040-copy.jpg?width=3840&quality=75&auto=webp)](\/news\/battle-gettysburg-turning-point-civil-war)\\n\\n[How the Battle of Gettysburg Turned the Tide of the Civil War\\\\\\n-------------------------------------------------------------\\\\\\n\\\\\\nIn a must-win clash, Union forces halted the northern invasion of Robert E. Lee\u2019s Confederate Army.\\\\\\n\\\\\\nRead more](\/news\/battle-gettysburg-turning-point-civil-war)\\n\\n[![The Lincoln Memorial in Washington, D.C.](https:\/\/assets.editorial.aetnd.com\/uploads\/2013\/03\/gettyimages-486565700.jpg?width=3840&quality=75&auto=webp)](\/news\/gettysburg-address-facts)\\n\\n[8 Surprising Facts About the Gettysburg Address\\\\\\n-----------------------------------------------\\\\\\n\\\\\\nAbraham Lincoln\u2019s Civil War-era speech is one for the ages.\\\\\\n\\\\\\nRead more](\/news\/gettysburg-address-facts)\\n\\n[![Abraham Lincoln making his famous address.Abraham Lincoln making his famous address on 19 November 1863 at the dedication of the Soldiers' National Cemetery at Gettysburg on the site of the American Civil War battle with the greatest number of casualties. Lithograph. (Photo by: Photo12\/Universal Images Group via Getty Images)](https:\/\/www.history.com\/this-day-in-history\/Photo%20by:%20Photo12\/Universal%20Images%20Group%20via%20Getty%20Images)](\/news\/abraham-lincoln-famous-quotes-speeches)\\n\\n[Abraham Lincoln\u2019s Most Enduring Speeches and Quotes\\\\\\n---------------------------------------------------\\\\\\n\\\\\\nFrom soaring oratory like the Gettysburg Address to folksy, humorous yarns, Lincoln knew how to wield the power of words.\\\\\\n\\\\\\nRead more](\/news\/abraham-lincoln-famous-quotes-speeches)\\n\\nAlso on This Day in History November | 19\\n-----------------------------------------\\n\\n* * *\\n\\n![](https:\/\/www.history.com\/editorial\/_next\/image?url=https%3A%2F%2Fassets.editorial.aetnd.com%2Fhistory-article-default.desktop.jpg&w=3840&q=75)[2004](\/this-day-in-history\/year\/2004)\\n\\n### [NBA players and fans brawl at infamous \\\"Malice at the Palace\\\" game](\/this-day-in-history\/sports-brawls-nba-infamous)\\n\\n[Sports](\/topics\/sports)\\n\\n![](https:\/\/www.history.com\/editorial\/_next\/image?url=https%3A%2F%2Fassets.editorial.aetnd.com%2Fuploads%2F2012%2F05%2Fthis-day-in-history-11-19-1863-lincoln-gettysburg-address.jpg&w=3840&q=75)\\n\\n### [This Day in History Video: What Happened on November 19](\/this-day-in-history\/november-19-video)\\n\\n[U.S. Presidents](\/topics\/us-presidents)\\n\\n![](https:\/\/www.history.com\/editorial\/_next\/image?url=https%3A%2F%2Fassets.editorial.aetnd.com%2Fhistory-article-default.desktop.jpg&w=3840&q=75)[1942](\/this-day-in-history\/year\/1942)\\n\\n### [Soviets launch counterattack at Stalingrad](\/this-day-in-history\/soviet-counterattack-at-stalingrad)\\n\\n[World War II](\/topics\/world-war-ii)\\n\\n![](https:\/\/assets.editorial.aetnd.com\/uploads\/2024\/10\/GettyImages-594896582.jpg?width=3840&quality=75&auto=webp)\\n\\n### Wake Up to This Day in History\\n\\nSign up now to learn about This Day in History straight from your inbox. \\nGet all of today's events in just one email featuring a range of topics.\\n\\nSign Up\\n\\nBy submitting your information, you agree to receive emails from HISTORY and A+E Networks. You can opt out at any time. You must be 16 years or older and a resident of the United States.\\n\\n**More details**: [Privacy Notice](https:\/\/www.aenetworks.com\/privacy)\\n | [Terms of Use](https:\/\/www.aenetworks.com\/terms)\\n | [Contact Us](https:\/\/support.history.com\/)\\n\\n![](https:\/\/www.history.com\/editorial\/_next\/image?url=https%3A%2F%2Fassets.editorial.aetnd.com%2Fhistory-article-default.desktop.jpg&w=3840&q=75)[1969](\/this-day-in-history\/year\/1969)\\n\\n### [Soccer legend Pel\u00e9 scores 1,000th goal](\/this-day-in-history\/pele-scores-1000th-goal)\\n\\n[Sports](\/topics\/sports)\\n\\n![](https:\/\/www.history.com\/editorial\/_next\/image?url=https%3A%2F%2Fassets.editorial.aetnd.com%2Fhistory-article-default.desktop.jpg&w=3840&q=75)[2003](\/this-day-in-history\/year\/2003)\\n\\n### [An arrest warrant is issued for Michael Jackson](\/this-day-in-history\/an-arrest-warrant-is-issued-for-michael-jackson)\\n\\n[Art, Literature and Film History](\/topics\/art-history)\\n\\n![](https:\/\/www.history.com\/editorial\/_next\/image?url=https%3A%2F%2Fassets.editorial.aetnd.com%2Fhistory-article-default.desktop.jpg&w=3840&q=75)[1975](\/this-day-in-history\/year\/1975)\\n\\n### [\u201cOne Flew Over the Cuckoo\u2019s Nest\u201d opens in theaters](\/this-day-in-history\/one-flew-over-the-cuckoos-nest-debuts)\\n\\n[Art, Literature and Film History](\/topics\/art-history)\\n\\n![](https:\/\/www.history.com\/editorial\/_next\/image?url=https%3A%2F%2Fassets.editorial.aetnd.com%2Fhistory-article-default.desktop.jpg&w=3840&q=75)[1976](\/this-day-in-history\/year\/1976)\\n\\n### [Patty Hearst out on bail](\/this-day-in-history\/patty-hearst-out-on-bail)\\n\\n[Crime](\/topics\/crime)\\n\\n![](https:\/\/www.history.com\/editorial\/_next\/image?url=https%3A%2F%2Fassets.editorial.aetnd.com%2Fhistory-article-default.desktop.jpg&w=3840&q=75)[1985](\/this-day-in-history\/year\/1985)\\n\\n### [Reagan and Gorbachev hold their first summit meeting](\/this-day-in-history\/reagan-and-gorbachev-hold-their-first-summit-meeting)\\n\\n[Cold War](\/topics\/cold-war)\",\"metadata\":{\"title\":\"President Lincoln delivers Gettysburg Address | November 19, 1863 | HISTORY\",\"description\":\"On November 19, 1863, at the dedication of a military cemetery at Gettysburg, Pennsylvania, during the American Civil War, President Lincoln delivers one of the most famous speeches in American history: the Gettysburg Address.\",\"language\":\"en\",\"robots\":\"index, follow\",\"ogTitle\":\"President Lincoln delivers Gettysburg Address | November 19, 1863 | HISTORY\",\"ogDescription\":\"On November 19, 1863, at the dedication of a military cemetery at Gettysburg, Pennsylvania, during the American Civil War, President Lincoln delivers one of the most famous speeches in American history: the Gettysburg Address.\",\"ogUrl\":\"https:\/\/www.history.com\/this-day-in-history\/lincoln-delivers-gettysburg-address\",\"ogImage\":\"https:\/\/assets.editorial.aetnd.com\/uploads\/2012\/05\/this-day-in-history-11-19-1863-lincoln-gettysburg-address.jpg\",\"ogLocale\":\"en_US\",\"ogLocaleAlternate\":[],\"ogSiteName\":\"HISTORY\",\"og:date\":\"2010-03-10T14:27:52\",\"viewport\":\"width=device-width, initial-scale=1\",\"theme-color\":\"#000000\",\"msapplication-TileColor\":\"#1d428a\",\"og:locale\":\"en_US\",\"og:type\":\"article\",\"og:title\":\"President Lincoln delivers Gettysburg Address | November 19, 1863 | HISTORY\",\"og:description\":\"On November 19, 1863, at the dedication of a military cemetery at Gettysburg, Pennsylvania, during the American Civil War, President Lincoln delivers one of the most famous speeches in American history: the Gettysburg Address.\",\"og:url\":\"https:\/\/www.history.com\/this-day-in-history\/lincoln-delivers-gettysburg-address\",\"og:site_name\":\"HISTORY\",\"og:image\":\"https:\/\/assets.editorial.aetnd.com\/uploads\/2012\/05\/this-day-in-history-11-19-1863-lincoln-gettysburg-address.jpg\",\"og:image:secure_url\":\"https:\/\/assets.editorial.aetnd.com\/uploads\/2012\/05\/this-day-in-history-11-19-1863-lincoln-gettysburg-address.jpg\",\"og:image:width\":\"1024\",\"og:image:height\":\"576\",\"twitter:card\":\"summary_large_image\",\"twitter:description\":\"On November 19, 1863, at the dedication of a military cemetery at Gettysburg, Pennsylvania, during the American Civil War, President Lincoln delivers one of the most famous speeches in American history: the Gettysburg Address.\",\"twitter:image\":\"https:\/\/assets.editorial.aetnd.com\/uploads\/2012\/05\/this-day-in-history-11-19-1863-lincoln-gettysburg-address.jpg\",\"google-site-verification\":\"91CWuHRY6kFZq2UzVQsD1stdYEf2zriY8lTCLFzfOmk\",\"next-head-count\":\"27\",\"sourceURL\":\"https:\/\/www.history.com\/this-day-in-history\/lincoln-delivers-gettysburg-address\",\"statusCode\":200}}}" +} diff --git a/tests/Fixtures/Saloon/AgentChains/Rat/RatAgentChainSerperTool-566ab17bb6275aec1c9b3987dfebd126.json b/tests/Fixtures/Saloon/AgentChains/Rat/RatAgentChainSerperTool-566ab17bb6275aec1c9b3987dfebd126.json new file mode 100644 index 0000000..69a9258 --- /dev/null +++ b/tests/Fixtures/Saloon/AgentChains/Rat/RatAgentChainSerperTool-566ab17bb6275aec1c9b3987dfebd126.json @@ -0,0 +1,9 @@ +{ + "statusCode": 200, + "headers": { + "access-control-allow-origin": "*", + "x-ratelimit-limit": "500", + "x-ratelimit-remaining": "499" + }, + "data": "{\"searchParameters\":{\"q\":\"\\\"American Civil War\\\" timeline 1861 \\\"Fort Sumter\\\" \\\"Bull Run\\\" \\\"Battle of Shiloh\\\" effects\",\"type\":\"search\",\"num\":10,\"engine\":\"google\"},\"organic\":[],\"credits\":1}" +} diff --git a/tests/Fixtures/Saloon/AgentChains/Rat/RatAgentChainSerperTool-6569dc605a724876f77e71cee5a3192d.json b/tests/Fixtures/Saloon/AgentChains/Rat/RatAgentChainSerperTool-6569dc605a724876f77e71cee5a3192d.json new file mode 100644 index 0000000..271cb6f --- /dev/null +++ b/tests/Fixtures/Saloon/AgentChains/Rat/RatAgentChainSerperTool-6569dc605a724876f77e71cee5a3192d.json @@ -0,0 +1,8 @@ +{ + "statusCode": 200, + "headers": { + "access-control-allow-origin": "*", + "x-ratelimit-limit": "500" + }, + "data": "{\"searchParameters\":{\"q\":\"American Civil War summary timeline, Battle of Gettysburg 1863, General Grant's leadership, Sherman's March to the Sea, Confederate General Lee's surrender at Appomattox Court House 1865, post-war Reconstruction\",\"type\":\"search\",\"num\":10,\"engine\":\"google\"},\"organic\":[{\"title\":\"Civil War Timeline - Gettysburg National Military Park (U.S. National ...\",\"link\":\"https://www.nps.gov/gett/learn/historyculture/civil-war-timeline.htm\",\"snippet\":\"It was here that US General Ulysses S. Grant gained his nickname \\\"Unconditional Surrender\\\" Grant. February 22, 1862- Jefferson Davis is inaugurated as President ...\",\"position\":1},{\"title\":\"Appomattox Court House - American Battlefield Trust\",\"link\":\"https://www.battlefields.org/learn/civil-war/battles/appomattox-court-house\",\"snippet\":\"Trapped by the Federals near Appomattox Court House, Confederate general Robert E. Lee surrendered his army to Union general Ulysses S. Grant.\",\"attributes\":{\"Missing\":\"1863, Reconstruction\"},\"position\":2},{\"title\":\"American Civil War | Timeline | Britannica\",\"link\":\"https://www.britannica.com/summary/American-Civil-War-Timeline\",\"snippet\":\"May\u2013July 1863 ... In the western theater of the war, General Ulysses S. Grant lays siege to the Confederate stronghold of Vicksburg, Mississippi. The Confederates ...\",\"attributes\":{\"Missing\":\"leadership, Reconstruction\"},\"position\":3},{\"title\":\"Civil War Timeline | American Battlefield Trust\",\"link\":\"https://www.battlefields.org/learn/articles/day-civil-war\",\"snippet\":\"Explore our timeline of the American Civil War and learn about the important events and battles that happened throughout this period of American history.\",\"date\":\"Feb 3, 2010\",\"position\":4},{\"title\":\"1863 | Civil War Glass Negatives and Related Prints\",\"link\":\"https://www.loc.gov/collections/civil-war-glass-negatives/articles-and-essays/time-line-of-the-civil-war/1863/\",\"snippet\":\"The Gettysburg Campaign\u200b\u200b Confederate General Lee decided to take the war to the enemy. On June 13, he defeated Union forces at Winchester, Virginia, and ...\",\"attributes\":{\"Missing\":\"leadership, Sea, Appomattox Court House Reconstruction\"},\"position\":5},{\"title\":\"Major Battles and Campaigns of the Civil War - American History\",\"link\":\"https://guides.lib.jjay.cuny.edu/c.php?g=288398&p=4496547\",\"snippet\":\"Fought on April 9 1865, the final battle between the forces of General Ulysses Grant and General Robert E Lee was the Battle of Appomattox Court ...\",\"date\":\"Sep 30, 2024\",\"position\":6},{\"title\":\"American Civil War - Wikipedia\",\"link\":\"https://en.wikipedia.org/wiki/American_Civil_War\",\"snippet\":\"The Confederates abandoned Richmond, and on April 9, 1865, Lee surrendered to Grant following the Battle of Appomattox Court House, setting in motion the end of ...\",\"position\":7},{\"title\":\"Sherman's March to the Sea | Significance, Map, Casualties, & The ...\",\"link\":\"https://www.britannica.com/topic/Shermans-March-to-the-Sea\",\"snippet\":\"The war effectively ended in April 1865 when Confederate General Robert E. Lee surrendered his troops to Union General Ulysses S. Grant at ...\",\"date\":\"5 days ago\",\"position\":8},{\"title\":\"Civil War Overview\",\"link\":\"https://www.civilwar.com/overview/timeline-18354/148542-civil-war-overview.html\",\"snippet\":\"This summary, organized yearly through maps and chronologies, shows the course of the war from Fort Sumter in 1861 to Appomattox Court House and beyond in 1865.\",\"position\":9},{\"title\":\"[PDF] American History What Was the Biggest Turning Point of the Civil ...\",\"link\":\"https://www.trumanlibrary.gov/public/Election1864-Material.pdf\",\"snippet\":\"Sherman's March to the Sea. -. The focus of Sherman's March was to destroy the Confederacy's capacity to make war. Railroads were a major target for Sherman.\",\"position\":10}],\"peopleAlsoAsk\":[{\"question\":\"What was the Civil War summary?\",\"snippet\":\"The Civil War was America's bloodiest and most divisive conflict, pitting the Union Army against the Confederate States of America. The war resulted in the deaths of more than 620,000 people, with millions more injured and the South left in ruins.\",\"title\":\"American Civil War: Causes, Dates & Battles | HISTORY\",\"link\":\"https://www.history.com/topics/american-civil-war\"},{\"question\":\"What 10 events happened in the Civil War?\",\"snippet\":\"SIGNIFICANT CIVIL WAR BATTLES\\nApril 12, 1861: Battle of Fort Sumter. ...\\nJune 30, 1861: Battle of Philippi. ...\\nJuly 21, 1861: First Battle of Bull Run/First Battle of Manassas. ...\\nAugust 28-29, 1861: Battle of Hatteras Inlet Batteries. ...\\nOctober 21, 1861: Battle of Ball's Bluff. ...\\nNovember 7, 1861: Battle of Belmont.\",\"title\":\"Significant Civil War Battles | American Experience - PBS\",\"link\":\"https://www.pbs.org/wgbh/americanexperience/features/timeline-death/\"},{\"question\":\"When was the American Civil War timeline?\",\"snippet\":\"The American Civil War (April 12, 1861 \u2013 May 26, 1865; also known by other names) was a civil war in the United States between the Union (\\\"the North\\\") and the Confederacy (\\\"the South\\\"), which was formed in 1861 by states that had seceded from the Union.\",\"title\":\"American Civil War - Wikipedia\",\"link\":\"https://en.wikipedia.org/wiki/American_Civil_War\"},{\"question\":\"What happened in 1863 during the Civil War?\",\"snippet\":\"1863. January 1, 1863- The Emancipation Proclamation goes into effect. The Emancipation Proclamation was a war measure that declared enslaved people in rebelling states to be free, authorized the enlistment of black troops, and outraged white Southerners.\",\"title\":\"Civil War Timeline - Gettysburg National Military Park (U.S. National ...\",\"link\":\"https://www.nps.gov/gett/learn/historyculture/civil-war-timeline.htm\"}],\"relatedSearches\":[{\"query\":\"Civil War Timeline 1861 To 1865\"},{\"query\":\"Who won the Civil War\"},{\"query\":\"When did the Civil War start and end\"},{\"query\":\"When did the Civil War end\"},{\"query\":\"Civil War battles in order\"},{\"query\":\"What was the first battle of the Civil War\"},{\"query\":\"what general led the confederate army into pennsylvania?\"},{\"query\":\"Where did the Civil War take place\"}],\"credits\":1}" +} diff --git a/tests/Fixtures/Saloon/AgentChains/Rat/RatAgentChainSerperTool-c94f9a735104da2fd9c0c44ea1ed1ba1.json b/tests/Fixtures/Saloon/AgentChains/Rat/RatAgentChainSerperTool-c94f9a735104da2fd9c0c44ea1ed1ba1.json new file mode 100644 index 0000000..6ea1f41 --- /dev/null +++ b/tests/Fixtures/Saloon/AgentChains/Rat/RatAgentChainSerperTool-c94f9a735104da2fd9c0c44ea1ed1ba1.json @@ -0,0 +1,8 @@ +{ + "statusCode": 200, + "headers": { + "access-control-allow-origin": "*", + "x-ratelimit-limit": "500" + }, + "data": "{\"searchParameters\":{\"q\":\"Significance of Gettysburg Address 1863, impact on American Civil War\",\"type\":\"search\",\"num\":10,\"engine\":\"google\"},\"answerBox\":{\"snippet\":\"Without mentioning words like \u201cConfederacy,\u201d \u201cslavery,\u201d or \u201csecession\u201d in the Gettysburg Address, Lincoln broadened the objectives of the Civil War to include not just preserving the Union as it was (with slavery largely intact in the South), but also achieving \u201ca new birth of freedom\u201d that would abolish slavery and, ...\",\"title\":\"The Civil War: Lincoln and the Gettysburg Address\",\"link\":\"https:\/\/www.gilderlehrman.org\/sites\/default\/files\/Unit6_Complete_CivilWar_0.pdf\"},\"organic\":[{\"title\":\"President Lincoln delivers Gettysburg Address | November 19, 1863\",\"link\":\"https:\/\/www.history.com\/this-day-in-history\/lincoln-delivers-gettysburg-address\",\"snippet\":\"The speech reflected his redefined belief that the Civil War was not just a fight to save the Union, but a struggle for freedom and equality for ...\",\"date\":\"Mar 10, 2010\",\"position\":1},{\"title\":\"The Gettysburg Address (1863) - The National Constitution Center\",\"link\":\"https:\/\/constitutioncenter.org\/the-constitution\/historic-document-library\/detail\/abraham-lincoln-the-gettysburg-address-1863\",\"snippet\":\"The Union victory at Gettysburg was a key moment in the Civil War\u2014thwarting General Robert E. Lee's invasion of the North. President Lincoln offered this brief ...\",\"position\":2},{\"title\":\"The Gettysburg Address \u2011 Definition, Meaning & Purpose | HISTORY\",\"link\":\"https:\/\/www.history.com\/topics\/american-civil-war\/gettysburg-address\",\"snippet\":\"In it, he invoked the principles of human equality contained in the Declaration of Independence and connected the sacrifices of the Civil War ...\",\"date\":\"Aug 24, 2010\",\"sitelinks\":[{\"title\":\"Gettysburg Address: Lincoln's...\",\"link\":\"https:\/\/www.history.com\/topics\/american-civil-war\/gettysburg-address#section_2\"},{\"title\":\"The Historic Gettysburg Address\",\"link\":\"https:\/\/www.history.com\/topics\/american-civil-war\/gettysburg-address#section_3\"}],\"position\":3},{\"title\":\"Gettysburg Address \u2013 Engage All Abilities\",\"link\":\"https:\/\/depts.washington.edu\/particip\/2019\/05\/06\/gettysburg-address\/\",\"snippet\":\"It added moral force to the Union cause and was a significant milestone leading to the ratification of the 13th Amendment to the Constitution in ...\",\"date\":\"May 6, 2019\",\"position\":4},{\"title\":\"Gettysburg Address Definition, Summary & Significance - Lesson\",\"link\":\"https:\/\/study.com\/academy\/lesson\/gettysburg-address-summary-analysis.html\",\"snippet\":\"The Gettysburg Address's significance is that it sought to give meaning to the sacrifice of soldiers who died during the war.\",\"position\":5},{\"title\":\"Gettysburg Battle Facts and Summary - American Battlefield Trust\",\"link\":\"https:\/\/www.battlefields.org\/learn\/civil-war\/battles\/gettysburg\",\"snippet\":\"Gettysburg ended Confederate general Robert E. Lee's ambitious second quest to invade the North and bring the Civil War to a swift end. The loss there dashed ...\",\"position\":6},{\"title\":\"The Gettysburg Address, 1863\",\"link\":\"https:\/\/www.gilderlehrman.org\/history-resources\/spotlight-primary-source\/gettysburg-address-1863\",\"snippet\":\"Lincoln's three-minute-long Gettysburg Address defined the meaning of the Civil War. Drawing upon the biblical concepts of suffering, consecration, and ...\",\"position\":7},{\"title\":\"Gettysburg Address | Abraham Lincoln Presidential Library and ...\",\"link\":\"https:\/\/presidentlincoln.illinois.gov\/visit\/whats-inside\/exhibits\/online-exhibits\/gettysburg-address-everett-copy\/\",\"snippet\":\"Lincoln is saying the Civil War is not just about the United States's future but is a test of whether any nation built on the promise of liberty and equality ...\",\"position\":8},{\"title\":\"Today in History - November 19 | Library of Congress\",\"link\":\"https:\/\/www.loc.gov\/item\/today-in-history\/november-19\/\",\"snippet\":\"On November 19, 1863, President Abraham Lincoln delivered a short speech at the close of ceremonies dedicating the battlefield cemetery at Gettysburg, ...\",\"date\":\"Nov 19, 2023\",\"position\":9}],\"peopleAlsoAsk\":[{\"question\":\"What impact did the Gettysburg Address have on the Civil War?\",\"snippet\":\"In his address, President Lincoln invoked the Declaration of Independence, and its principles of liberty and equality, and spoke of \u201ca new birth of freedom\u201d for the nation. He continued to reshape the aims of the war for the American people-transforming it from a war for Union to a war for Union and freedom.\\nMay 6, 2019\",\"title\":\"Gettysburg Address \u2013 Engage All Abilities\",\"link\":\"https:\/\/depts.washington.edu\/particip\/2019\/05\/06\/gettysburg-address\/\"},{\"question\":\"What was Gettysburg impact on the Civil War?\",\"snippet\":\"Union victory. Gettysburg ended Confederate general Robert E. Lee's ambitious second quest to invade the North and bring the Civil War to a swift end. The loss there dashed the hopes of the Confederate States of America to become an independent nation.\",\"title\":\"Gettysburg Battle Facts and Summary - American Battlefield Trust\",\"link\":\"https:\/\/www.battlefields.org\/learn\/civil-war\/battles\/gettysburg\"},{\"question\":\"What was the significance of the Gettysburg Address for slavery?\",\"snippet\":\"The speech was a turning point in his war strategy in that, for the first time, he began to openly speak of the abolition of slavery as a desired outcome of the war, a \\\"new birth of freedom.\\\" The mural above depicts an allegory of emancipation in the center.\",\"title\":\"Lincoln Memorial: Emancipation & Gettysburg Address\",\"link\":\"https:\/\/www.nps.gov\/places\/000\/lincoln-memorial-emancipation-gettysburg-address.htm\"},{\"question\":\"What was the significance of the Civil War in 1863?\",\"snippet\":\"On January 1, 1863, Abraham Lincoln issued the final Emancipation Proclamation, which declared that all slaves within the rebellious states \u201care, and henceforward shall be free.\u201d Bitterly denounced in the South\u2014and by many in the North\u2014the Proclamation reduced the likelihood that the anti-slavery European powers would ...\",\"title\":\"December 1862\u2013October 1863 - The Civil War in America | Exhibitions\",\"link\":\"https:\/\/www.loc.gov\/exhibits\/civil-war-in-america\/december-1862-october-1863.html\"}],\"relatedSearches\":[{\"query\":\"How did the Gettysburg Address impact the Civil War\"},{\"query\":\"Why was the Gettysburg Address important\"},{\"query\":\"Why is the Gettysburg Address important today\"},{\"query\":\"What was the purpose of the Gettysburg Address\"},{\"query\":\"Gettysburg Address text\"},{\"query\":\"Gettysburg Address meaning line by line\"},{\"query\":\"Gettysburg Address summary\"},{\"query\":\"Who was the audience of the Gettysburg Address\"}],\"credits\":1}" +} diff --git a/tests/Fixtures/Saloon/AgentChains/Rat/RatAgentChainSerperTool-d4bf31054d2e78fbc5e45673b16c9a89.json b/tests/Fixtures/Saloon/AgentChains/Rat/RatAgentChainSerperTool-d4bf31054d2e78fbc5e45673b16c9a89.json new file mode 100644 index 0000000..7c3930c --- /dev/null +++ b/tests/Fixtures/Saloon/AgentChains/Rat/RatAgentChainSerperTool-d4bf31054d2e78fbc5e45673b16c9a89.json @@ -0,0 +1,8 @@ +{ + "statusCode": 200, + "headers": { + "access-control-allow-origin": "*", + "x-ratelimit-limit": "500" + }, + "data": "{\"searchParameters\":{\"q\":\"American Civil War 1862 key events Emancipation Proclamation and Battle of Antietam\",\"type\":\"search\",\"num\":10,\"engine\":\"google\"},\"answerBox\":{\"snippet\":\"On Sept. 22, 1862, President Abraham Lincoln changed the course of American history by announcing that enslaved people would soon be free. Commonly referred to as the 'preliminary' Emancipation Proclamation, Lincoln's action that day was emboldened by a Union victory at the Battle of Antietam only days earlier.\",\"snippetHighlighted\":[\"Sept.\",\"22, 1862, President Abraham Lincoln changed the course of American history by announcing that enslaved people would soon be free\"],\"title\":\"160 years later: Remembering the Battle of Antietam and the ...\",\"link\":\"https:\/\/www.georgiasouthern.edu\/news\/2022\/09\/27\/160-years-later-remembering-the-battle-of-antietam-and-the-preliminary-emancipation-proclamation-that-reshaped-american-history\/\",\"date\":\"Sep 27, 2022\"},\"organic\":[{\"title\":\"Antietam Battle Facts and Summary | American Battlefield Trust\",\"link\":\"https:\/\/www.battlefields.org\/learn\/civil-war\/battles\/antietam\",\"snippet\":\"Antietam, the deadliest one-day battle in American military history, showed that the Union could stand against the Confederate army in the Eastern theater.\",\"position\":1},{\"title\":\"American Civil War - Battle of Antietam, Emancipation Proclamation ...\",\"link\":\"https:\/\/www.britannica.com\/event\/American-Civil-War\/The-war-in-1862\",\"snippet\":\"The year 1862 marked a major turning point in the war, especially the war in the East, as Lee took command of the Confederate army.\",\"date\":\"Oct 11, 2024\",\"position\":2},{\"title\":\"1862 | Civil War Glass Negatives and Related Prints\",\"link\":\"https:\/\/www.loc.gov\/collections\/civil-war-glass-negatives\/articles-and-essays\/time-line-of-the-civil-war\/1862\/\",\"snippet\":\"On January 27, President Lincoln issued a war order authorizing the Union to launch a unified aggressive action against the Confederacy.\",\"position\":3},{\"title\":\"Civil War Timeline - Gettysburg National Military Park (U.S. National ...\",\"link\":\"https:\/\/www.nps.gov\/gett\/learn\/historyculture\/civil-war-timeline.htm\",\"snippet\":\"September 22, 1862- Following the US victory at Antietam, President Lincoln introduces the Preliminary Emancipation Proclamation, which announced Lincoln's ...\",\"position\":4},{\"title\":\"Emancipation Proclamation (1863) - National Archives\",\"link\":\"https:\/\/www.archives.gov\/milestone-documents\/emancipation-proclamation\",\"snippet\":\"President Abraham Lincoln issued the Emancipation Proclamation on January 1, 1863, announcing, \\\"that all persons held as slaves\\\" within the rebellious areas \\\" ...\",\"date\":\"May 10, 2022\",\"position\":5},{\"title\":\"Emancipation Proclamation \u2011 Definition, Dates & Summary | HISTORY\",\"link\":\"https:\/\/www.history.com\/topics\/american-civil-war\/emancipation-proclamation\",\"snippet\":\"On September 22, 1862, President Abraham Lincoln issued the preliminary Emancipation Proclamation, which declared that as of January 1, 1863, all enslaved ...\",\"date\":\"Oct 29, 2009\",\"position\":6},{\"title\":\"Timeline | Abraham Lincoln and Emancipation | Articles and Essays\",\"link\":\"https:\/\/www.loc.gov\/collections\/abraham-lincoln-papers\/articles-and-essays\/abraham-lincoln-and-emancipation\/timeline\/\",\"snippet\":\"1862, Sept.\u200b\u200b President Lincoln issued the Preliminary Emancipation Proclamation, declaring that as of January 1, 1863 \\\"all persons held as slaves within any ...\",\"position\":7},{\"title\":\"Freedom at Antietam - National Park Service\",\"link\":\"https:\/\/www.nps.gov\/anti\/learn\/historyculture\/freedom-at-antietam.htm\",\"snippet\":\"Five days after the battle, armed with pen and paper, Abraham Lincoln changed the war when he issued the Emancipation Proclamation. The ...\",\"date\":\"Sep 15, 2023\",\"position\":8},{\"title\":\"7 Ways the Battle of Antietam Changed America | HISTORY\",\"link\":\"https:\/\/www.history.com\/news\/7-ways-the-battle-of-antietam-changed-america\",\"snippet\":\"The battle allowed Abraham Lincoln to issue the Emancipation Proclamation. For two months, Lincoln's order proclaiming the freedom of enslaved ...\",\"date\":\"Sep 14, 2012\",\"position\":9}],\"peopleAlsoAsk\":[{\"question\":\"What was the Battle of Antietam and Emancipation Proclamation?\",\"snippet\":\"As the glowing sun set over the bloody fields of Antietam, the Civil War became a different war. Five days after the battle, armed with pen and paper, Abraham Lincoln changed the war when he issued the Emancipation Proclamation. The proclamation reflected Lincoln's new way of thinking about the conflict.\\nSep 15, 2023\",\"title\":\"Freedom at Antietam - National Park Service\",\"link\":\"https:\/\/www.nps.gov\/anti\/learn\/historyculture\/freedom-at-antietam.htm\"},{\"question\":\"What key events happened in the Antietam Battle?\",\"snippet\":\"September 17. The Battle of Antietam begins at dawn when Hooker's Union corps mounts a powerful assault on Lee's left flank. Repeated Union attacks and equally vicious Confederate counterattacks sweep back and forth across Miller's cornfield and the West Woods.\",\"title\":\"Antietam Battle Facts and Summary | American Battlefield Trust\",\"link\":\"https:\/\/www.battlefields.org\/learn\/civil-war\/battles\/antietam\"},{\"question\":\"What three events happened in 1862 civil war?\",\"snippet\":\"1862\\nJanuary 1862. Abraham Lincoln Takes Action. ...\\nMarch 1862. McClellan Loses Command. ...\\nApril 1862. The Battle of Shiloh. ...\\nApril 1862. New Orleans. ...\\nApril 1862. The Peninsular Campaign. ...\\nMay 1862. \\\"Stonewall\\\" Jackson Defeats Union Forces. ...\\nJune 1862. The Battle of Seven Pines (Fair Oaks) ...\\nJuly 1862. The Seven Days' Battles.\",\"title\":\"1862 | Civil War Glass Negatives and Related Prints\",\"link\":\"https:\/\/www.loc.gov\/collections\/civil-war-glass-negatives\/articles-and-essays\/time-line-of-the-civil-war\/1862\/\"},{\"question\":\"What happened at the Battle of Antietam in 1862?\",\"snippet\":\"The Battle of Antietam ended the Confederate Army of Northern Virginia's first invasion into the North and led Abraham Lincoln to issue the preliminary Emancipation Proclamation.\",\"title\":\"Antietam National Battlefield (U.S. National Park Service)\",\"link\":\"https:\/\/www.nps.gov\/ancm\/\"}],\"relatedSearches\":[{\"query\":\"Who won the Battle of Antietam\"},{\"query\":\"1862 Civil War Timeline\"},{\"query\":\"1862 Civil War Battle\"},{\"query\":\"Where was the Battle of Antietam\"},{\"query\":\"Why was the Battle of Antietam important\"},{\"query\":\"What happened in 1862 in American History\"},{\"query\":\"Battle of Antietam casualties\"},{\"query\":\"When did the Battle of Antietam end\"}],\"credits\":1}" +} diff --git a/tests/Fixtures/Saloon/AgentChains/RatAgentChain-0dac52efdcd81f0dae4be83cc7dd9134.json b/tests/Fixtures/Saloon/AgentChains/RatAgentChain-0dac52efdcd81f0dae4be83cc7dd9134.json deleted file mode 100644 index c0b7531..0000000 --- a/tests/Fixtures/Saloon/AgentChains/RatAgentChain-0dac52efdcd81f0dae4be83cc7dd9134.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "statusCode": 200, - "headers": { - "Date": "Thu, 17 Oct 2024 01:56:08 GMT", - "Content-Type": "application\/json", - "Transfer-Encoding": "chunked", - "Connection": "keep-alive" - }, - "data": "{\n \"id\": \"chatcmpl-AJA25VaNBB4t2ZMS8lc44qZO7WB9x\",\n \"object\": \"chat.completion\",\n \"created\": 1729130161,\n \"model\": \"gpt-4-turbo-2024-04-09\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"```json\\n{\\n \\\"paragraphs\\\": [\\n \\\"Improving heart health is a multifaceted endeavor that includes lifestyle changes and medical strategies. First and foremost, diet plays a critical role in heart health. Reducing the intake of saturated fats, trans fats, and cholesterol-rich foods is advisable, as these can contribute to plaque buildup in arteries. Instead, focus on eating a variety of fruits, vegetables, whole grains, and lean proteins to keep your heart healthy.\\\",\\n \\\"Regular physical activity is also crucial for maintaining a healthy heart. Aim for at least 150 minutes of moderate aerobic exercise or 75 minutes of vigorous exercise each week, combined with muscle-strengthening activities on two or more days a week.\\\",\\n \\\"Avoiding tobacco in any form is one of the most significant steps you can take to protect your heart. Smoking and the use of tobacco products increase the risk of developing cardiovascular diseases. If you smoke, seek help to quit as soon as possible.\\\",\\n \\\"Monitoring your health with regular check-ups can help catch and address potential heart issues before they become severe. This includes keeping an eye on blood pressure, cholesterol levels, and blood sugar, especially if you have a family history of heart disease. Lastly, managing stress and ensuring adequate sleep each night contribute to overall heart health. Engage in stress-reducing activities that you enjoy and aim for 7-9 hours of sleep per night to promote heart health.\\\"\\n ]\\n}\\n```\",\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 381,\n \"completion_tokens\": 294,\n \"total_tokens\": 675,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0\n }\n },\n \"system_fingerprint\": \"fp_83975a045a\"\n}\n" -} diff --git a/tests/Fixtures/Saloon/AgentChains/RatAgentChain-23b86031e4743be2f58c64dd85d11f40.json b/tests/Fixtures/Saloon/AgentChains/RatAgentChain-23b86031e4743be2f58c64dd85d11f40.json deleted file mode 100644 index a430148..0000000 --- a/tests/Fixtures/Saloon/AgentChains/RatAgentChain-23b86031e4743be2f58c64dd85d11f40.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "statusCode": 200, - "headers": { - "Date": "Tue, 22 Oct 2024 01:27:52 GMT", - "Content-Type": "application\/json", - "Transfer-Encoding": "chunked", - "Connection": "keep-alive", - "access-control-expose-headers": "X-Request-ID", - "openai-organization": "user-5hvzt3x5aqwr0picqhxifwl8", - "openai-processing-ms": "6899", - "openai-version": "2020-10-01", - "x-ratelimit-limit-requests": "10000", - "x-ratelimit-limit-tokens": "2000000", - "x-ratelimit-remaining-requests": "9999", - "x-ratelimit-remaining-tokens": "1999844", - "x-ratelimit-reset-requests": "6ms", - "x-ratelimit-reset-tokens": "4ms", - "x-request-id": "req_fd9e16fe1d41d69704c264020d6ae42d", - "strict-transport-security": "max-age=31536000; includeSubDomains; preload", - "CF-Cache-Status": "DYNAMIC", - "Set-Cookie": [ - "__cf_bm=cSkNNrqiYZL3V1thOKDP5jrTIIk37edj.kGz89SszVg-1729560472-1.0.1.1-op2FlAkf5QMH6IhEYgQhsLOg4LHxseuhdpHwjiOul.3ZEybv_F_bpORQIiTK5ufJdO.pBGsZOOTWxRk0ImZmDw; path=\/; expires=Tue, 22-Oct-24 01:57:52 GMT; domain=.api.openai.com; HttpOnly; Secure; SameSite=None", - "_cfuvid=XPTKjmKQYCUkhuhErTbb8MlVyfHpmVTb_B9VZBRGZpk-1729560472549-0.0.1.1-604800000; path=\/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None" - ], - "X-Content-Type-Options": "nosniff", - "Server": "cloudflare", - "CF-RAY": "8d65b4ed6c8c4245-EWR", - "alt-svc": "h3=\":443\"; ma=86400" - }, - "data": "{\n \"id\": \"chatcmpl-AKxyTO57jKrY1c8OP8tpx6inpsw8K\",\n \"object\": \"chat.completion\",\n \"created\": 1729560465,\n \"model\": \"gpt-4-turbo-2024-04-09\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"```json\\n{\\n \\\"answer\\\": \\\"Improving heart health is a multifaceted approach involving diet, exercise, lifestyle choices, and monitoring health metrics. \\n\\nFirstly, focusing on a healthy diet is crucial. Aim to incorporate plenty of fruits, vegetables, whole grains, and lean proteins into your daily meals. Reduce intake of saturated fats, trans fats, and cholesterol to help decrease blood pressure and improve lipid profiles. Consider also reducing salt and sugar, which particularly benefit heart health by lowering blood pressure and reducing the risk of cardiovascular disease. \\n\\nSecondly, regular physical activity is essential. The American Heart Association recommends at least 150 minutes of moderate aerobic exercise, or 75 minutes of vigorous exercise, each week. This can include activities like walking, jogging, cycling, or swimming. Regular exercise helps maintain a healthy weight, lowers blood pressure, improves circulation, and strengthens the heart muscle.\\n\\nThirdly, lifestyle modifications play a significant role. If you smoke, quitting is perhaps the most significant step you can take to protect your cardiovascular health. Limiting alcohol consumption and managing stress through techniques like meditation, deep breathing exercises, or yoga can also positively impact heart health.\\n\\nLastly, it\u2019s important to monitor your health through regular check-ups with your doctor. This includes checking your blood pressure, cholesterol levels, and other pertinent heart-related metrics. If you have a family history of heart disease, these check-ups become even more critical as they can help catch potential issues early.\\n\\nBy integrating these practices into your life, you can significantly enhance your heart health and reduce the risk of heart diseases.\\\"\\n}\\n```\",\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 116,\n \"completion_tokens\": 320,\n \"total_tokens\": 436,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0\n }\n },\n \"system_fingerprint\": \"fp_83975a045a\"\n}\n" -} \ No newline at end of file diff --git a/tests/Fixtures/Saloon/AgentChains/RatAgentChain-3a4abc7b397c195a952d147f5999c932.json b/tests/Fixtures/Saloon/AgentChains/RatAgentChain-3a4abc7b397c195a952d147f5999c932.json deleted file mode 100644 index a4719f0..0000000 --- a/tests/Fixtures/Saloon/AgentChains/RatAgentChain-3a4abc7b397c195a952d147f5999c932.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "statusCode": 200, - "headers": { - "Date": "Tue, 22 Oct 2024 01:28:20 GMT", - "Content-Type": "application\/json", - "Transfer-Encoding": "chunked", - "Connection": "keep-alive", - "access-control-expose-headers": "X-Request-ID", - "openai-organization": "user-5hvzt3x5aqwr0picqhxifwl8", - "openai-processing-ms": "8876", - "openai-version": "2020-10-01", - "x-ratelimit-limit-requests": "10000", - "x-ratelimit-limit-tokens": "2000000", - "x-ratelimit-remaining-requests": "9999", - "x-ratelimit-remaining-tokens": "1999396", - "x-ratelimit-reset-requests": "6ms", - "x-ratelimit-reset-tokens": "18ms", - "x-request-id": "req_840559461212cf82d64cbd4b1ae04559", - "strict-transport-security": "max-age=31536000; includeSubDomains; preload", - "CF-Cache-Status": "DYNAMIC", - "Set-Cookie": [ - "__cf_bm=RjU4dU2ruXhZ.6WQLXLzA2tsCP7dIYLjNISOHvuD30U-1729560500-1.0.1.1-HuXR5QvzxbScL5RSZkfMGW4fY8oI8UJ.Ury0mBkYicFLO0cCkh2OdT9AkuxvJ8.DnLFZimkZrejysKIGWLhjTQ; path=\/; expires=Tue, 22-Oct-24 01:58:20 GMT; domain=.api.openai.com; HttpOnly; Secure; SameSite=None", - "_cfuvid=bJWdtNemdE6f8qGUAEvHMdvlubcWuPjg8QZADZZONfc-1729560500635-0.0.1.1-604800000; path=\/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None" - ], - "X-Content-Type-Options": "nosniff", - "Server": "cloudflare", - "CF-RAY": "8d65b590ccd642e7-EWR", - "alt-svc": "h3=\":443\"; ma=86400" - }, - "data": "{\n \"id\": \"chatcmpl-AKxytzFzQVlilr4h8iF847NpkL9Qs\",\n \"object\": \"chat.completion\",\n \"created\": 1729560491,\n \"model\": \"gpt-4-turbo-2024-04-09\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"{\\n \\\"paragraphs\\\": [\\n \\\"Improving heart health is crucial and can be achieved through a combination of diet, exercise, lifestyle adjustments, and regular medical check-ups. Firstly, diet plays a fundamental role in heart health. Incorporating a variety of fruits, vegetables, whole grains, and lean proteins into your diet helps manage weight and lowers the risk of heart disease. It is also important to minimize the intake of saturated fats, trans fats, excess sodium, and sugars, all of which can negatively impact heart health.\\\",\\n \\\"Secondly, exercise is essential for maintaining a healthy heart. Aim for at least 150 minutes of moderate aerobic activity or 75 minutes of vigorous activity per week, as recommended by health organizations like the American Heart Association. Regular physical activity not only strengthens the heart but also helps control weight, reduces arterial stiffness, and improves overall cardiovascular endurance.\\\",\\n \\\"Thirdly, lifestyle changes are vital for heart health. Quitting smoking and reducing alcohol intake are top priorities, as both have been linked to heart disease. Additionally, managing stress through mindfulness, meditation, or yoga can positively affect your heart health by reducing stress hormones and inflammation.\\\",\\n \\\"Finally, regular health check-ups are indispensable for maintaining heart health. These check-ups help monitor blood pressure, cholesterol levels, and other heart-related indicators, allowing for early detection and management of potential health issues. By integrating these strategies into your daily life, you can significantly enhance your cardiac function and overall heart health, leading to a longer, healthier life.\\\"\\n ]\\n}\\n```\",\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 440,\n \"completion_tokens\": 309,\n \"total_tokens\": 749,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0\n }\n },\n \"system_fingerprint\": \"fp_eae715ec6a\"\n}\n" -} \ No newline at end of file diff --git a/tests/Fixtures/Saloon/AgentChains/RatAgentChain-3d6768be2549ac5e1a0e44d2ed1eb2c1.json b/tests/Fixtures/Saloon/AgentChains/RatAgentChain-3d6768be2549ac5e1a0e44d2ed1eb2c1.json deleted file mode 100644 index a5372fd..0000000 --- a/tests/Fixtures/Saloon/AgentChains/RatAgentChain-3d6768be2549ac5e1a0e44d2ed1eb2c1.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "statusCode": 200, - "headers": { - "Date": "Tue, 22 Oct 2024 01:28:02 GMT", - "Content-Type": "application\/json", - "Transfer-Encoding": "chunked", - "Connection": "keep-alive", - "access-control-expose-headers": "X-Request-ID", - "openai-organization": "user-5hvzt3x5aqwr0picqhxifwl8", - "openai-processing-ms": "9568", - "openai-version": "2020-10-01", - "x-ratelimit-limit-requests": "10000", - "x-ratelimit-limit-tokens": "2000000", - "x-ratelimit-remaining-requests": "9999", - "x-ratelimit-remaining-tokens": "1999293", - "x-ratelimit-reset-requests": "6ms", - "x-ratelimit-reset-tokens": "21ms", - "x-request-id": "req_52ff88b78eb40f3aa93b4ff53e50d77a", - "strict-transport-security": "max-age=31536000; includeSubDomains; preload", - "CF-Cache-Status": "DYNAMIC", - "Set-Cookie": [ - "__cf_bm=VC3i2ik2t3JGhiVxi8O.UBz_n5KpT0eGWyr09uk.cdM-1729560482-1.0.1.1-jYw8Cz2T9Z2UcV8M4w2dViD.D2kaihil8Qf69PpoY6J4pbAR0rmQIZOWAHTXKxEMhZqUZ5eiv6OwKJRr8bK4cA; path=\/; expires=Tue, 22-Oct-24 01:58:02 GMT; domain=.api.openai.com; HttpOnly; Secure; SameSite=None", - "_cfuvid=EFrlVOrrRA4uHwjqALJbB7M2hCZPTU_wOydaH17Hxdw-1729560482546-0.0.1.1-604800000; path=\/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None" - ], - "X-Content-Type-Options": "nosniff", - "Server": "cloudflare", - "CF-RAY": "8d65b51b5d2e43dd-EWR", - "alt-svc": "h3=\":443\"; ma=86400" - }, - "data": "{\n \"id\": \"chatcmpl-AKxyblN6CbCJCwiPpb13BChH8TgHQ\",\n \"object\": \"chat.completion\",\n \"created\": 1729560473,\n \"model\": \"gpt-4-turbo-2024-04-09\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"```json\\n{\\n \\\"answer\\\": \\\"Improving heart health involves a combination of diet, exercise, lifestyle choices, and regular medical check-ups. \\n\\nFirstly, adjusting your diet is a key factor in boosting heart health. Incorporate a variety of fruits, vegetables, and whole grains into your meals. Focus on eating lean proteins and limit your intake of unhealthy fats, sodium, and added sugars. This approach can help manage your body weight, reduce cholesterol, and lower blood pressure, all of which are beneficial for heart health.\\n\\nSecondly, exercise is crucial for maintaining a healthy heart. The American Heart Association recommends at least 150 minutes of moderate-intensity aerobic exercise, or 75 minutes of vigorous exercise per week. Regular physical activity helps strengthen the heart muscle, improves blood circulation, and can help you maintain a healthy weight.\\n\\nAdditionally, lifestyle modifications are necessary for optimal heart health. If you smoke, quitting is one of the most powerful steps you can take. Managing stress through techniques like yoga, meditation, or regular relaxation can also have profound benefits on your cardiovascular health. Limiting alcohol intake is recommended as it can have a direct impact on heart conditions.\\n\\nLastly, routine health screenings are vital. Regular visits to your healthcare provider for blood pressure, cholesterol, and diabetes screenings can help detect problems early and facilitate timely intervention. Discussing your family's health history with your doctor can also provide insights into your personal risk factors and guide preventive measures.\\n\\nBy implementing these strategies, you can improve your heart health significantly and decrease the risk of heart-related diseases.\\\"\\n}\\n```\",\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 525,\n \"completion_tokens\": 314,\n \"total_tokens\": 839,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0\n }\n },\n \"system_fingerprint\": \"fp_eae715ec6a\"\n}\n" -} \ No newline at end of file diff --git a/tests/Fixtures/Saloon/AgentChains/RatAgentChain-7e62e7ca508c58a7dd52e9451a68d9b2.json b/tests/Fixtures/Saloon/AgentChains/RatAgentChain-7e62e7ca508c58a7dd52e9451a68d9b2.json deleted file mode 100644 index 6d6dd98..0000000 --- a/tests/Fixtures/Saloon/AgentChains/RatAgentChain-7e62e7ca508c58a7dd52e9451a68d9b2.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "statusCode": 200, - "headers": { - "Date": "Tue, 22 Oct 2024 01:28:11 GMT", - "Content-Type": "application/json", - "Transfer-Encoding": "chunked", - "Connection": "keep-alive", - "access-control-expose-headers": "X-Request-ID", - "openai-organization": "user-5hvzt3x5aqwr0picqhxifwl8", - "openai-processing-ms": "8222", - "openai-version": "2020-10-01", - "x-ratelimit-limit-requests": "10000", - "x-ratelimit-limit-tokens": "2000000", - "x-ratelimit-remaining-requests": "9999", - "x-ratelimit-remaining-tokens": "1998750", - "x-ratelimit-reset-requests": "6ms", - "x-ratelimit-reset-tokens": "37ms", - "x-request-id": "req_eb79e82455779172b64cf352d1fcd0ba", - "strict-transport-security": "max-age=31536000; includeSubDomains; preload", - "CF-Cache-Status": "DYNAMIC", - "Set-Cookie": [ - "__cf_bm=pthxdFvkAVee_uTckkTmSScEXcueUclhCP26WPMAGlI-1729560491-1.0.1.1-r_SOEF1Xfv22ckOB79QM.bk9YcAvHFxsW5hC14NnclNDLwa5LaURig3B7QldesktEoUplk4YKJrvk6BWLIS5Ew; path=/; expires=Tue, 22-Oct-24 01:58:11 GMT; domain=.api.openai.com; HttpOnly; Secure; SameSite=None", - "_cfuvid=1RlVzYSrZzPIaOYAp0rMVbchRSinWkZR_Wf8Dt.N1O0-1729560491210-0.0.1.1-604800000; path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None" - ], - "X-Content-Type-Options": "nosniff", - "Server": "cloudflare", - "CF-RAY": "8d65b559ebfb8cec-EWR", - "alt-svc": "h3=\":443\"; ma=86400" - }, - "data": "{\n \"id\": \"chatcmpl-AKxyl6kWTV5RgXszK4gabSDHNO7eh\",\n \"object\": \"chat.completion\",\n \"created\": 1729560483,\n \"model\": \"gpt-4-turbo-2024-04-09\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"```json\\n{\\n \\\"answer\\\": \\\"Improving heart health is crucial and can be achieved through a combination of diet, exercise, lifestyle adjustments, and regular medical check-ups. \\\\n\\\\nFirstly, diet plays a fundamental role in heart health. Incorporating a variety of fruits, vegetables, whole grains, and lean proteins into your diet helps manage weight and lowers the risk of heart disease. It is also important to minimize the intake of saturated fats, trans fats, excess sodium, and sugars, all of which can negatively impact heart health. \\\\n\\\\nSecondly, exercise is essential for maintaining a healthy heart. Aim for at least 150 minutes of moderate aerobic activity or 75 minutes of vigorous activity per week, as recommended by health organizations like the American Heart Association. Regular physical activity not only strengthens the heart but also helps control weight, reduces arterial stiffness, and improves overall cardiovascular endurance. \\\\n\\\\nThirdly, lifestyle changes are vital for heart health. Quitting smoking and reducing alcohol intake are top priorities, as both have been linked to heart disease. Additionally, managing stress through mindfulness, meditation, or yoga can positively affect your heart health by reducing stress hormones and inflammation. \\\\n\\\\nFinally, regular health check-ups are indispensable for maintaining heart health. These check-ups help monitor blood pressure, cholesterol levels, and other heart-related indicators, allowing for early detection and management of potential health issues. \\\\n\\\\nBy integrating these strategies into your daily life, you can significantly enhance your cardiac function and overall heart health, leading to a longer, healthier life.\\\"\\n}\\n```\",\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 928,\n \"completion_tokens\": 317,\n \"total_tokens\": 1245,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0\n }\n },\n \"system_fingerprint\": \"fp_eae715ec6a\"\n}\n" -} diff --git a/tests/Fixtures/Saloon/AgentChains/RatAgentChain-9ce86b41e54066cf052469d1d46c848d.json b/tests/Fixtures/Saloon/AgentChains/RatAgentChain-9ce86b41e54066cf052469d1d46c848d.json deleted file mode 100644 index ede9289..0000000 --- a/tests/Fixtures/Saloon/AgentChains/RatAgentChain-9ce86b41e54066cf052469d1d46c848d.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "statusCode": 200, - "headers": { - "Date": "Thu, 17 Oct 2024 01:51:50 GMT", - "Content-Type": "application/json", - "Transfer-Encoding": "chunked", - "Connection": "keep-alive" - }, - "data": "{\n \"id\": \"chatcmpl-AJ9xp1Dm5MRjmPh5TsT1gZUsvvbBF\",\n \"object\": \"chat.completion\",\n \"created\": 1729129897,\n \"model\": \"gpt-4-turbo-2024-04-09\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"```json\\n{\\n \\\"answer\\\": \\\"Improving heart health is a multifaceted endeavor that includes lifestyle changes and medical strategies. First and foremost, diet plays a critical role in heart health. Reducing the intake of saturated fats, trans fats, and cholesterol-rich foods is advisable, as these can contribute to plaque buildup in arteries. Instead, focus on eating a variety of fruits, vegetables, whole grains, and lean proteins to keep your heart healthy.\\\\n\\\\nRegular physical activity is also crucial for maintaining a healthy heart. Aim for at least 150 minutes of moderate aerobic exercise or 75 minutes of vigorous exercise each week, combined with muscle-strengthening activities on two or more days a week. Avoiding tobacco in any form is one of the most significant steps you can take to protect your heart. Smoking and the use of tobacco products increase the risk of developing cardiovascular diseases. If you smoke, seek help to quit as soon as possible.\\\\n\\\\nMonitoring your health with regular check-ups can help catch and address potential heart issues before they become severe. This includes keeping an eye on blood pressure, cholesterol levels, and blood sugar, especially if you have a family history of heart disease. Lastly, managing stress and ensuring adequate sleep each night contribute to overall heart health. Engage in stress-reducing activities that you enjoy and aim for 7-9 hours of sleep per night to promote heart health.\\\"\\n}\\n```\",\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 364,\n \"completion_tokens\": 287,\n \"total_tokens\": 651,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0\n }\n },\n \"system_fingerprint\": \"fp_83975a045a\"\n}\n" -} diff --git a/tests/Fixtures/Saloon/AgentChains/RatAgentChain-c8b871f5b66ceee6cdd6a4f41ca4809e.json b/tests/Fixtures/Saloon/AgentChains/RatAgentChain-c8b871f5b66ceee6cdd6a4f41ca4809e.json deleted file mode 100644 index 0d8758f..0000000 --- a/tests/Fixtures/Saloon/AgentChains/RatAgentChain-c8b871f5b66ceee6cdd6a4f41ca4809e.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "statusCode": 200, - "headers": { - "Date": "Thu, 17 Oct 2024 01:50:28 GMT", - "Content-Type": "application\/json", - "Transfer-Encoding": "chunked", - "Connection": "keep-alive" - }, - "data": "{\n \"id\": \"chatcmpl-AJ9wZnNOMYPTf1cGDenfRqL1FZVs8\",\n \"object\": \"chat.completion\",\n \"created\": 1729129819,\n \"model\": \"gpt-4-turbo-2024-04-09\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"```json\\n{\\n \\\"answer\\\": \\\"Improving heart health is a multifaceted endeavor that includes lifestyle changes and medical strategies. First and foremost, diet plays a critical role in heart health. Reducing the intake of saturated fats, trans fats, and cholesterol-rich foods is advisable, as these can contribute to plaque buildup in arteries. Instead, focus on eating a variety of fruits, vegetables, whole grains, and lean proteins to keep your heart healthy.\\\\n\\\\nRegular physical activity is also crucial for maintaining a healthy heart. Aim for at least 150 minutes of moderate aerobic exercise or 75 minutes of vigorous exercise each week, combined with muscle-strengthening activities on two or more days a week.\\\\n\\\\nAvoiding tobacco in any form is one of the most significant steps you can take to protect your heart. Smoking and the use of tobacco products increase the risk of developing cardiovascular diseases. If you smoke, seek help to quit as soon as possible.\\\\n\\\\nMonitoring your health with regular check-ups can help catch and address potential heart issues before they become severe. This includes keeping an eye on blood pressure, cholesterol levels, and blood sugar, especially if you have a family history of heart disease.\\\\n\\\\nLastly, managing stress and ensuring adequate sleep each night contribute to overall heart health. Engage in stress-reducing activities that you enjoy and aim for 7-9 hours of sleep per night to promote heart health.\\\"\\n}\\n```\",\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 145,\n \"completion_tokens\": 291,\n \"total_tokens\": 436,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0\n }\n },\n \"system_fingerprint\": \"fp_83975a045a\"\n}\n" -} diff --git a/tests/Fixtures/Saloon/AgentChains/RatAgentChain-e6be3b2a969ae75116175e3c039cc2f2.json b/tests/Fixtures/Saloon/AgentChains/RatAgentChain-e6be3b2a969ae75116175e3c039cc2f2.json deleted file mode 100644 index 89a5763..0000000 --- a/tests/Fixtures/Saloon/AgentChains/RatAgentChain-e6be3b2a969ae75116175e3c039cc2f2.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "statusCode": 200, - "headers": { - "Date": "Thu, 17 Oct 2024 01:50:18 GMT", - "Content-Type": "application\/json", - "Transfer-Encoding": "chunked", - "Connection": "keep-alive", - "access-control-expose-headers": "X-Request-ID" - }, - "data": "{\n \"id\": \"chatcmpl-AJ9wS3DmlVd0DuHRikV5zpDZekJLG\",\n \"object\": \"chat.completion\",\n \"created\": 1729129812,\n \"model\": \"gpt-4-turbo-2024-04-09\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"```json\\n{\\n \\\"answer\\\": \\\"Improving heart health is a significant concern for maintaining overall well-being and can be achieved through a combination of lifestyle changes, dietary adjustments, and regular medical check-ups. \\n\\nFirstly, engaging in regular physical activity is one of the most effective ways to strengthen the heart. Aim for at least 150 minutes of moderate aerobic exercise or 75 minutes of vigorous exercise each week. Activities could include walking, cycling, swimming, or sprinting. Exercise helps reduce hypertension, lower cholesterol, and keep body weight under control.\\n\\nSecondly, diet plays a crucial role in heart health. Incorporating heart-healthy foods into your diet can enhance cardiovascular function and reduce risk factors. Focus on eating a variety of fruits and vegetables, whole grains, lean proteins such as fish and legumes, and nuts and seeds. Limit the intake of saturated fats, trans fats, cholesterol, salt (sodium), and added sugars. Opt for cooking methods that require less fat, such as boiling, baking, or steaming rather than frying.\\n\\nAdditionally, managing stress and ensuring adequate sleep each night are vital components of heart health. Chronic stress and poor sleep patterns can lead to increased heart rate and blood pressure, potentially causing long-term harm to the heart. Employ relaxation techniques such as meditation, deep breathing exercises, or yoga. Strive for 7-9 hours of quality sleep per night.\\n\\nRegularly monitoring health metrics and consulting with healthcare professionals are also crucial. Keep track of your blood pressure, cholesterol levels, and body weight. Regular check-ups will help in early identification and management of any potential heart issues. Quitting smoking and limiting alcohol intake are also beneficial for maintaining a healthy heart.\\n\\nBy consistently applying these strategies, you can significantly improve and maintain your heart health over time.\\\"\\n}\\n```\",\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 81,\n \"completion_tokens\": 362,\n \"total_tokens\": 443,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0\n }\n },\n \"system_fingerprint\": \"fp_83975a045a\"\n}\n" -} diff --git a/tests/Fixtures/Saloon/Integrations/ClaudeToolTestAgent-9ae29f2ff260a200c78e895234990b88.json b/tests/Fixtures/Saloon/Integrations/ClaudeToolTestAgent-9ae29f2ff260a200c78e895234990b88.json new file mode 100644 index 0000000..7d8a3dd --- /dev/null +++ b/tests/Fixtures/Saloon/Integrations/ClaudeToolTestAgent-9ae29f2ff260a200c78e895234990b88.json @@ -0,0 +1,10 @@ +{ + "statusCode": 200, + "headers": { + "Date": "Thu, 24 Oct 2024 01:33:41 GMT", + "Content-Type": "application\/json", + "Content-Length": "515", + "Connection": "keep-alive" + }, + "data": "{\"id\":\"msg_016sUkaDosKYyTYiwnDqJq6v\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-5-sonnet-20240620\",\"content\":[{\"type\":\"text\",\"text\":\"{\\n \\\"answer\\\": \\\"The current president of the United States is Joe Biden. He is the 46th president, having taken office in 2021. Biden previously served as the 47th Vice President and represented Delaware in the U.S. Senate for 36 years before becoming president.\\\"\\n}\"}],\"stop_reason\":\"end_turn\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1847,\"output_tokens\":68}}" +} diff --git a/tests/Fixtures/Saloon/Integrations/ClaudeToolTestAgent-c31fbf2a429a96687e99c3b94fd406f3.json b/tests/Fixtures/Saloon/Integrations/ClaudeToolTestAgent-c31fbf2a429a96687e99c3b94fd406f3.json new file mode 100644 index 0000000..8a15af2 --- /dev/null +++ b/tests/Fixtures/Saloon/Integrations/ClaudeToolTestAgent-c31fbf2a429a96687e99c3b94fd406f3.json @@ -0,0 +1,9 @@ +{ + "statusCode": 200, + "headers": { + "Date": "Thu, 24 Oct 2024 01:33:40 GMT", + "Content-Type": "application\/json", + "Content-Length": "688" + }, + "data": "{\"id\":\"msg_01Rf1cmavyQXHwrTKuRBDpwt\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-5-sonnet-20240620\",\"content\":[{\"type\":\"text\",\"text\":\"Based on the search results, I can provide you with the information about the current president of the United States:\\n\\n```json\\n{\\n \\\"answer\\\": \\\"The current president of the United States is Joe Biden. He is the 46th and current president, having taken office in 2021. Joe Biden previously served as the 47th Vice President of the United States and represented Delaware in the U.S. Senate for 36 years before becoming president.\\\"\\n}\\n```\"}],\"stop_reason\":\"end_turn\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1648,\"output_tokens\":104}}" +} diff --git a/tests/Fixtures/Saloon/Integrations/OllamaToolTestAgent-dd3c1226bcfb52db4cac0fc3cd00f4f0.json b/tests/Fixtures/Saloon/Integrations/OllamaToolTestAgent-dd3c1226bcfb52db4cac0fc3cd00f4f0.json new file mode 100644 index 0000000..7de4de3 --- /dev/null +++ b/tests/Fixtures/Saloon/Integrations/OllamaToolTestAgent-dd3c1226bcfb52db4cac0fc3cd00f4f0.json @@ -0,0 +1,9 @@ +{ + "statusCode": 200, + "headers": { + "Content-Type": "application\/json; charset=utf-8", + "Date": "Thu, 24 Oct 2024 01:34:12 GMT", + "Content-Length": "376" + }, + "data": "{\"model\":\"llama3.2\",\"created_at\":\"2024-10-24T01:34:12.828517139Z\",\"message\":{\"role\":\"assistant\",\"content\":\"{\\\"answer\\\": \\\"Joe Biden is the current President of the United States.\\\"}\"},\"done_reason\":\"stop\",\"done\":true,\"total_duration\":30057119000,\"load_duration\":2077610548,\"prompt_eval_count\":1061,\"prompt_eval_duration\":26605401000,\"eval_count\":17,\"eval_duration\":1199741000}" +} \ No newline at end of file diff --git a/tests/Fixtures/Saloon/Integrations/OpenAiToolTestAgent-75c161b01e340522e8715d4c26443fa9.json b/tests/Fixtures/Saloon/Integrations/OpenAiToolTestAgent-75c161b01e340522e8715d4c26443fa9.json new file mode 100644 index 0000000..51d7285 --- /dev/null +++ b/tests/Fixtures/Saloon/Integrations/OpenAiToolTestAgent-75c161b01e340522e8715d4c26443fa9.json @@ -0,0 +1,10 @@ +{ + "statusCode": 200, + "headers": { + "Date": "Thu, 24 Oct 2024 01:34:14 GMT", + "Content-Type": "application\/json", + "Content-Length": "676", + "Connection": "keep-alive" + }, + "data": "{\n \"id\": \"chatcmpl-ALh1qLnFxQ7etMVx5Urpmd4TCuMTH\",\n \"object\": \"chat.completion\",\n \"created\": 1729733654,\n \"model\": \"gpt-4-turbo-2024-04-09\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"```json\\n{\\n \\\"answer\\\": \\\"Joe Biden\\\"\\n}\\n```\",\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 1119,\n \"completion_tokens\": 15,\n \"total_tokens\": 1134,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0\n }\n },\n \"system_fingerprint\": \"fp_ed14c08274\"\n}\n" +} diff --git a/tests/Fixtures/Saloon/Tools/SerperTestAgent-f7bf86866f50c4d6aa1c3352ff0b6f8c.json b/tests/Fixtures/Saloon/Tools/SerperTestAgent-f7bf86866f50c4d6aa1c3352ff0b6f8c.json new file mode 100644 index 0000000..5e75921 --- /dev/null +++ b/tests/Fixtures/Saloon/Tools/SerperTestAgent-f7bf86866f50c4d6aa1c3352ff0b6f8c.json @@ -0,0 +1,10 @@ +{ + "statusCode": 200, + "headers": { + "Date": "Thu, 24 Oct 2024 01:34:23 GMT", + "Content-Type": "application\/json", + "Content-Length": "674", + "Connection": "keep-alive" + }, + "data": "{\n \"id\": \"chatcmpl-ALh1yZ5j6xTEBEKFVf3GSWKOTiPdq\",\n \"object\": \"chat.completion\",\n \"created\": 1729733662,\n \"model\": \"gpt-4-turbo-2024-04-09\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"```json\\n{\\n \\\"answer\\\": \\\"Joe Biden\\\"\\n}\\n```\",\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 321,\n \"completion_tokens\": 15,\n \"total_tokens\": 336,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0\n }\n },\n \"system_fingerprint\": \"fp_eae715ec6a\"\n}\n" +} diff --git a/tests/Integrations/ClaudeIntegrationTest.php b/tests/Integrations/ClaudeIntegrationTest.php index b3b33fa..edaec0f 100644 --- a/tests/Integrations/ClaudeIntegrationTest.php +++ b/tests/Integrations/ClaudeIntegrationTest.php @@ -2,23 +2,23 @@ declare(strict_types=1); - use Saloon\Http\Faking\Fixture; - use Saloon\Http\Faking\MockClient; - use Saloon\Http\Faking\MockResponse; - use Saloon\Http\PendingRequest; - use UseTheFork\Synapse\Agent; - use UseTheFork\Synapse\Contracts\Agent\HasIntegration; - use UseTheFork\Synapse\Contracts\Integration; - use UseTheFork\Synapse\Contracts\Memory; - use UseTheFork\Synapse\Integrations\ClaudeIntegration; - use UseTheFork\Synapse\Integrations\Connectors\Claude\Requests\ChatRequest; - use UseTheFork\Synapse\Memory\CollectionMemory; - use UseTheFork\Synapse\Services\Serper\Requests\SerperSearchRequest; - use UseTheFork\Synapse\Tools\Search\SerperTool; - use UseTheFork\Synapse\Traits\Agent\ValidatesOutputSchema; - use UseTheFork\Synapse\ValueObject\SchemaRule; - - test('Connects', function (): void { + use Saloon\Http\Faking\Fixture; + use Saloon\Http\Faking\MockClient; + use Saloon\Http\Faking\MockResponse; + use Saloon\Http\PendingRequest; + use UseTheFork\Synapse\Agent; + use UseTheFork\Synapse\Contracts\Agent\HasIntegration; + use UseTheFork\Synapse\Contracts\Integration; + use UseTheFork\Synapse\Contracts\Memory; + use UseTheFork\Synapse\Integrations\ClaudeIntegration; + use UseTheFork\Synapse\Integrations\Connectors\Claude\Requests\ChatRequest; + use UseTheFork\Synapse\Memory\CollectionMemory; + use UseTheFork\Synapse\Services\Serper\Requests\SerperSearchRequest; + use UseTheFork\Synapse\Tools\Search\SerperTool; + use UseTheFork\Synapse\Traits\Agent\ValidatesOutputSchema; + use UseTheFork\Synapse\ValueObject\SchemaRule; + + test('Connects', function (): void { class ClaudeTestAgent extends Agent implements HasIntegration { @@ -106,5 +106,5 @@ protected function resolveTools(): array expect($agentResponseArray['content'])->toBeArray() ->and($agentResponseArray['content'])->toHaveKey('answer') - ->and($agentResponseArray['content']['answer'])->toContain('The current president of the United States is Joe Biden. He is the 46th president of the United States and took office in 2021. Joe Biden previously served as the 47th Vice President of the United States and represented Delaware in the US Senate for 36 years before becoming president.'); + ->and($agentResponseArray['content']['answer'])->toContain('The current president of the United States is Joe Biden. He is the 46th president, having taken office in 2021.'); }); diff --git a/tests/Integrations/OllamaIntegrationTest.php b/tests/Integrations/OllamaIntegrationTest.php index 9fbdeb3..d3769f3 100644 --- a/tests/Integrations/OllamaIntegrationTest.php +++ b/tests/Integrations/OllamaIntegrationTest.php @@ -2,21 +2,21 @@ declare(strict_types=1); - use Saloon\Http\Faking\Fixture; - use Saloon\Http\Faking\MockClient; - use Saloon\Http\Faking\MockResponse; - use Saloon\Http\PendingRequest; - use UseTheFork\Synapse\Agent; - use UseTheFork\Synapse\Contracts\Agent\HasIntegration; - use UseTheFork\Synapse\Contracts\Integration; - use UseTheFork\Synapse\Integrations\Connectors\Ollama\Requests\ChatRequest; - use UseTheFork\Synapse\Integrations\OllamaIntegration; - use UseTheFork\Synapse\Services\Serper\Requests\SerperSearchRequest; - use UseTheFork\Synapse\Tools\Search\SerperTool; - use UseTheFork\Synapse\Traits\Agent\ValidatesOutputSchema; - use UseTheFork\Synapse\ValueObject\SchemaRule; - - test('Connects', function (): void { +use Saloon\Http\Faking\Fixture; +use Saloon\Http\Faking\MockClient; +use Saloon\Http\Faking\MockResponse; +use Saloon\Http\PendingRequest; +use UseTheFork\Synapse\Agent; +use UseTheFork\Synapse\Contracts\Agent\HasIntegration; +use UseTheFork\Synapse\Contracts\Integration; +use UseTheFork\Synapse\Integrations\Connectors\Ollama\Requests\ChatRequest; +use UseTheFork\Synapse\Integrations\OllamaIntegration; +use UseTheFork\Synapse\Services\Serper\Requests\SerperSearchRequest; +use UseTheFork\Synapse\Tools\Search\SerperTool; +use UseTheFork\Synapse\Traits\Agent\ValidatesOutputSchema; +use UseTheFork\Synapse\ValueObject\SchemaRule; + +test('Connects', function (): void { class OllamaTestAgent extends Agent implements HasIntegration { @@ -106,5 +106,5 @@ protected function resolveTools(): array expect($agentResponseArray['content'])->toBeArray() ->and($agentResponseArray['content'])->toHaveKey('answer') - ->and($agentResponseArray['content']['answer'])->toBe('The current President of the United States is Joe Biden.'); + ->and($agentResponseArray['content']['answer'])->toBe('Joe Biden is the current President of the United States.'); }); diff --git a/tests/Integrations/OpenAiIntegrationTest.php b/tests/Integrations/OpenAiIntegrationTest.php index 4900af9..61444b2 100644 --- a/tests/Integrations/OpenAiIntegrationTest.php +++ b/tests/Integrations/OpenAiIntegrationTest.php @@ -2,22 +2,22 @@ declare(strict_types=1); - use Saloon\Http\Faking\Fixture; - use Saloon\Http\Faking\MockClient; - use Saloon\Http\Faking\MockResponse; - use Saloon\Http\PendingRequest; - use UseTheFork\Synapse\Agent; - use UseTheFork\Synapse\Contracts\Agent\HasIntegration; - use UseTheFork\Synapse\Contracts\Agent\HasOutputSchema; - use UseTheFork\Synapse\Contracts\Integration; - use UseTheFork\Synapse\Integrations\Connectors\OpenAI\Requests\ChatRequest; - use UseTheFork\Synapse\Integrations\OpenAIIntegration; - use UseTheFork\Synapse\Services\Serper\Requests\SerperSearchRequest; - use UseTheFork\Synapse\Tools\Search\SerperTool; - use UseTheFork\Synapse\Traits\Agent\ValidatesOutputSchema; - use UseTheFork\Synapse\ValueObject\SchemaRule; - - test('Connects with out resolveIntegration', function (): void { +use Saloon\Http\Faking\Fixture; +use Saloon\Http\Faking\MockClient; +use Saloon\Http\Faking\MockResponse; +use Saloon\Http\PendingRequest; +use UseTheFork\Synapse\Agent; +use UseTheFork\Synapse\Contracts\Agent\HasIntegration; +use UseTheFork\Synapse\Contracts\Agent\HasOutputSchema; +use UseTheFork\Synapse\Contracts\Integration; +use UseTheFork\Synapse\Integrations\Connectors\OpenAI\Requests\ChatRequest; +use UseTheFork\Synapse\Integrations\OpenAIIntegration; +use UseTheFork\Synapse\Services\Serper\Requests\SerperSearchRequest; +use UseTheFork\Synapse\Tools\Search\SerperTool; +use UseTheFork\Synapse\Traits\Agent\ValidatesOutputSchema; +use UseTheFork\Synapse\ValueObject\SchemaRule; + +test('Connects with out resolveIntegration', function (): void { class OpenAiWithOutResolveTestAgent extends Agent implements HasOutputSchema { @@ -136,5 +136,5 @@ protected function resolveTools(): array expect($agentResponseArray['content'])->toBeArray() ->and($agentResponseArray['content'])->toHaveKey('answer') - ->and($agentResponseArray['content']['answer'])->toBe('Joe Biden is the current President of the United States.'); + ->and($agentResponseArray['content']['answer'])->toBe('Joe Biden'); });