diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1c9207a..84231bc 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -4,7 +4,7 @@ on: push: branches: - main - - dev-main + - development jobs: test: runs-on: ubuntu-22.04 @@ -24,6 +24,7 @@ jobs: CRUNCHBASE_API_KEY: FOO FIRECRAWL_API_KEY: FOO SERPAPI_API_KEY: FOO + OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} steps: - name: Checkout 🛎 diff --git a/config/synapse.php b/config/synapse.php index 4b27a28..2973f49 100644 --- a/config/synapse.php +++ b/config/synapse.php @@ -16,6 +16,11 @@ 'key' => env('ANTHROPIC_API_KEY'), 'chat_model' => env('ANTHROPIC_API_CHAT_MODEL', 'claude-3-5-sonnet-20240620'), ], + 'ollama' => [ + 'base_url' => env('OLLAMA_BASE_URL'), + 'chat_model' => env('OLLAMA_API_CHAT_MODEL', 'llama3.2'), + 'embedding_model' => env('OLLAMA_API_CHAT_MODEL', 'llama3.2'), + ], ], 'services' => [ 'serp_api' => [ diff --git a/docs/.vitepress/config.mjs b/docs/.vitepress/config.mjs index 4c4896c..0965fb7 100644 --- a/docs/.vitepress/config.mjs +++ b/docs/.vitepress/config.mjs @@ -1,4 +1,4 @@ -import {defineConfig} from 'vitepress'; +import { defineConfig } from 'vitepress'; // https://vitepress.dev/reference/site-config export default defineConfig({ title: '🧠 Synapse', @@ -9,6 +9,15 @@ export default defineConfig({ // https://vitepress.dev/reference/default-theme-config nav: [ { text: 'Home', link: '/' }, + { + text: '0.2.0', + items: [ + { + text: 'Changelog', + link: 'https://github.com/use-the-fork/synapse/tree/v0.2.0', + }, + ], + }, { text: '0.1.0', items: [ @@ -31,28 +40,28 @@ export default defineConfig({ }, ], }, - { - text: 'Prebuilt Agents', - items: [ - { text: 'Introduction', link: '/prebuilt-agents/' }, - { - text: 'Multi Query Retriever', - link: '/prebuilt-agents/multi-query-retriever-agent', - }, - { - text: 'Contextual Retrieval Preprocessing', - link: '/prebuilt-agents/contextual-retrieval-preprocessing-agent', - }, - { - text: 'Chat Rephrase', - link: '/prebuilt-agents/chat-rephrase-agent', - }, - { - text: 'SQL Tool', - link: '/prebuilt-agents/sql-tool-agent', - }, - ], - }, + { + text: 'Prebuilt Agents', + items: [ + { text: 'Introduction', link: '/prebuilt-agents/' }, + { + text: 'Multi Query Retriever', + link: '/prebuilt-agents/multi-query-retriever-agent', + }, + { + text: 'Contextual Retrieval Preprocessing', + link: '/prebuilt-agents/contextual-retrieval-preprocessing-agent', + }, + { + text: 'Chat Rephrase', + link: '/prebuilt-agents/chat-rephrase-agent', + }, + { + text: 'SQL Tool', + link: '/prebuilt-agents/sql-tool-agent', + }, + ], + }, { text: 'Agents', items: [ diff --git a/docs/agents/integrations.md b/docs/agents/integrations.md index e868bdb..5c6746c 100644 --- a/docs/agents/integrations.md +++ b/docs/agents/integrations.md @@ -1,13 +1,14 @@ # Integrations -Synapse currently supports two integrations: OpenAI and Claude. To use either, add the relevant API key to your `.env` file. +Synapse currently supports three integrations: OpenAI, Claude, and Ollama. To use them, add the relevant API key to your `.env` file. ```dotenv +OLLAMA_BASE_URL=https://foo.bar:1234 OPENAI_API_KEY= ANTHROPIC_API_KEY= ``` -Then, implement the chosen integration in your agent's `resolveIntegration` method. +Then, either implement the chosen integration in your agent's `resolveIntegration` method or set the default integration in your synapse config. ## OpenAI @@ -34,3 +35,16 @@ public function resolveIntegration(): Integration return new ClaudeIntegration; } ``` + +## Ollama + +```php +use UseTheFork\Synapse\Integrations\OllamaIntegration; + +... + +public function resolveIntegration(): Integration +{ + return new OllamaIntegration; +} +``` diff --git a/docs/index.md b/docs/index.md index 37184a1..70481b3 100644 --- a/docs/index.md +++ b/docs/index.md @@ -34,6 +34,10 @@ OPENAI_API_EMBEDDING_MODEL=text-embedding-ada-002 ANTHROPIC_API_KEY= ANTHROPIC_API_CHAT_MODEL=claude-3-5-sonnet-20240620 +OLLAMA_BASE_URL=https://foo.bar:1234 +OLLAMA_API_CHAT_MODEL=llama3.2 +OLLAMA_API_EMBEDDING_MODEL=llama3.2 + SERPAPI_API_KEY= SERPER_API_KEY= CLEARBIT_API_KEY= @@ -80,6 +84,11 @@ Open the `config/synapse.php` file and modify the default integration to the one 'key' => env('ANTHROPIC_API_KEY'), 'chat_model' => env('ANTHROPIC_API_CHAT_MODEL', 'claude-3-5-sonnet-20240620'), ], + 'ollama' => [ + 'base_url' => env('OLLAMA_BASE_URL'), + 'chat_model' => env('OLLAMA_API_CHAT_MODEL', 'llama3.2'), + 'embedding_model' => env('OLLAMA_API_CHAT_MODEL', 'llama3.2'), + ], ], ``` diff --git a/resources/views/Parts/OutputSchema.blade.php b/resources/views/Parts/OutputSchema.blade.php index 5513049..ff2b3d6 100644 --- a/resources/views/Parts/OutputSchema.blade.php +++ b/resources/views/Parts/OutputSchema.blade.php @@ -1,4 +1,10 @@ @isset($outputSchema) -### You must respond using the following schema. Immediately return valid JSON formatted data: +### Mandatory Response Format +Return all responses exclusively in JSON format following this structure with out **ANY** surrounding text: {!! $outputSchema !!} + +Always ensure that the response adheres strictly to this format, as it will be used for API purposes. + +### Start Response ### +```json @endisset diff --git a/resources/views/Prompts/Rat/DraftPrompt.blade.php b/resources/views/Prompts/Rat/DraftPrompt.blade.php new file mode 100644 index 0000000..50f30ba --- /dev/null +++ b/resources/views/Prompts/Rat/DraftPrompt.blade.php @@ -0,0 +1,10 @@ + +### Instruction +Try to answer this question/instruction with step-by-step thoughts and make the answer more structural. Split the answer into several paragraphs. +{!! $question !!} + +@include('synapse::Parts.OutputSchema') + + + + diff --git a/resources/views/Prompts/Rat/GetQueryPrompt.blade.php b/resources/views/Prompts/Rat/GetQueryPrompt.blade.php new file mode 100644 index 0000000..4e19d4d --- /dev/null +++ b/resources/views/Prompts/Rat/GetQueryPrompt.blade.php @@ -0,0 +1,11 @@ + +## User input: {{ $question }} + +## Response +{{ $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. + +@include('synapse::Parts.OutputSchema') + diff --git a/resources/views/Prompts/Rat/SplitAnswerPrompt.blade.php b/resources/views/Prompts/Rat/SplitAnswerPrompt.blade.php new file mode 100644 index 0000000..4fd5efa --- /dev/null +++ b/resources/views/Prompts/Rat/SplitAnswerPrompt.blade.php @@ -0,0 +1,12 @@ + +## User input: {{ $question }} + +## Response +{{ $answer }} + +## Instruction +Split the answer of the question into multiple paragraphs with each paragraph containing a complete thought. +The answer should be splited into less than {{ $number_of_paragraphs }} paragraphs. + +@include('synapse::Parts.OutputSchema') + diff --git a/resources/views/Prompts/ReValidateResponsePrompt.blade.php b/resources/views/Prompts/ReValidateResponsePrompt.blade.php index 17eca72..b5c331e 100644 --- a/resources/views/Prompts/ReValidateResponsePrompt.blade.php +++ b/resources/views/Prompts/ReValidateResponsePrompt.blade.php @@ -1,11 +1,12 @@ -# Instruction -Your final response did not adhere the required Schema. -** DO NOT EXPLAIN. Only return your final response with the requested format.** - -## You must respond in this format: -{!! $outputRules !!} - @if(!empty($errors)) -## The following error occurred in the last Rewrite: +## The following error occurred in the last response: {!! $errors !!} @endif + +@if(!empty($lastResponse)) +### Start Last Response ### +{!! $lastResponse !!} +### End Last Response ### +@endif + +@include('synapse::Parts.OutputSchema') diff --git a/src/Agent.php b/src/Agent.php index 1c9c29d..991968e 100644 --- a/src/Agent.php +++ b/src/Agent.php @@ -23,8 +23,8 @@ class Agent { use HasMiddleware; - use ManagesIntegration, - ManagesTools; + use ManagesIntegration; + use ManagesTools; /** * a keyed array of values to be used as extra inputs that are passed to the prompt when it is generated. diff --git a/src/AgentChain.php b/src/AgentChain.php new file mode 100644 index 0000000..d08a373 --- /dev/null +++ b/src/AgentChain.php @@ -0,0 +1,76 @@ +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. + * + * @param array|null $input The input array. + * @param array|null $extraAgentArgs The extra agent arguments array. + * @return Message The final message from the agent. + * + * @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; + } + } diff --git a/src/AgentTask/PendingAgentChain.php b/src/AgentTask/PendingAgentChain.php new file mode 100644 index 0000000..24f8803 --- /dev/null +++ b/src/AgentTask/PendingAgentChain.php @@ -0,0 +1,46 @@ +agentChain = $agentChain; + + $this + ->tap(new BootTraits); + + } + + /** + * Tap into the agent chain + * + * @return $this + */ + protected function tap(callable $callable): static + { + $callable($this); + + return $this; + } + + /** + * Retrieve the agent associated with the current task. + * + * @return AgentChain The current agent instance. + */ + public function agent(): AgentChain + { + return $this->agentChain; + } + +} diff --git a/src/AgentTask/StartTasks/BootTraits.php b/src/AgentTask/StartTasks/BootTraits.php index 45d40da..6714aeb 100644 --- a/src/AgentTask/StartTasks/BootTraits.php +++ b/src/AgentTask/StartTasks/BootTraits.php @@ -5,6 +5,7 @@ namespace UseTheFork\Synapse\AgentTask\StartTasks; + use UseTheFork\Synapse\AgentTask\PendingAgentChain; use UseTheFork\Synapse\AgentTask\PendingAgentTask; use UseTheFork\Synapse\Helpers\Helpers; @@ -13,7 +14,7 @@ class BootTraits /** * Boot the plugins */ - public function __invoke(PendingAgentTask $pendingAgentTask): PendingAgentTask + public function __invoke(PendingAgentTask|PendingAgentChain $pendingAgentTask): PendingAgentTask|PendingAgentChain { $agent = $pendingAgentTask->agent(); diff --git a/src/Agents/Rat/GetQueryAgent.php b/src/Agents/Rat/GetQueryAgent.php new file mode 100644 index 0000000..97a44f8 --- /dev/null +++ b/src/Agents/Rat/GetQueryAgent.php @@ -0,0 +1,27 @@ + 'query', + 'rules' => 'required|string', + 'description' => 'The query to search for.', + ]), + ]; + } +} diff --git a/src/Agents/Rat/RatDraftAgent.php b/src/Agents/Rat/RatDraftAgent.php new file mode 100644 index 0000000..4fc878b --- /dev/null +++ b/src/Agents/Rat/RatDraftAgent.php @@ -0,0 +1,27 @@ + 'answer', + 'rules' => 'required|string', + 'description' => 'Your answer split in to paragraphs.', + ]), + ]; + } +} diff --git a/src/Agents/Rat/RatSplitAnswerAgent.php b/src/Agents/Rat/RatSplitAnswerAgent.php new file mode 100644 index 0000000..bb26cac --- /dev/null +++ b/src/Agents/Rat/RatSplitAnswerAgent.php @@ -0,0 +1,32 @@ + 'paragraphs', + 'rules' => 'required|array', + 'description' => 'Your answer split in to paragraphs.', + ]), + SchemaRule::make([ + 'name' => 'paragraphs.*', + 'rules' => 'required|string', + 'description' => 'A paragraph of your answer.', + ]), + ]; + } +} diff --git a/src/Contracts/ArrayStore.php b/src/Contracts/ArrayStore.php new file mode 100644 index 0000000..0b58038 --- /dev/null +++ b/src/Contracts/ArrayStore.php @@ -0,0 +1,60 @@ + + */ + public function all(): array; + + /** + * Retrieve a single item. + */ + public function get(string $key, mixed $default = null): mixed; + + /** + * Determine if the store is empty + */ + public function isEmpty(): bool; + + /** + * Determine if the store is not empty + */ + public function isNotEmpty(): bool; + + /** + * Merge in other arrays. + * + * @param array ...$arrays + * @return $this + */ + public function merge(array ...$arrays): static; + + /** + * Remove an item from the store. + * + * @return $this + */ + public function remove(string $key): static; + + /** + * Overwrite the entire repository's contents. + * + * @param array $data + * @return $this + */ + public function set(array $data): static; + } diff --git a/src/Helpers/Helpers.php b/src/Helpers/Helpers.php index 30242af..4a42e7a 100644 --- a/src/Helpers/Helpers.php +++ b/src/Helpers/Helpers.php @@ -6,6 +6,7 @@ use Closure; use ReflectionClass; +use UseTheFork\Synapse\AgentTask\PendingAgentChain; use UseTheFork\Synapse\AgentTask\PendingAgentTask; /** @@ -22,7 +23,7 @@ final class Helpers * * @throws \ReflectionException */ - public static function bootPlugin(PendingAgentTask $pendingAgentTask, string $trait): void + public static function bootPlugin(PendingAgentTask|PendingAgentChain $pendingAgentTask, string $trait): void { $agent = $pendingAgentTask->agent(); diff --git a/src/Integrations/ClaudeIntegration.php b/src/Integrations/ClaudeIntegration.php index 17a4b07..77d6137 100644 --- a/src/Integrations/ClaudeIntegration.php +++ b/src/Integrations/ClaudeIntegration.php @@ -13,23 +13,9 @@ class ClaudeIntegration implements Integration { - /** - * {@inheritdoc} - */ - public function handlePendingAgentTaskCompletion( - PendingAgentTask $pendingAgentTask - ): PendingAgentTask { - - $claudeAIConnector = new ClaudeAIConnector; - $message = $claudeAIConnector->doCompletionRequest( - prompt: $pendingAgentTask->currentIteration()->getPromptChain(), - tools: $pendingAgentTask->tools(), - extraAgentArgs: $pendingAgentTask->currentIteration()->getExtraAgentArgs() - ); - - $pendingAgentTask->currentIteration()->setResponse($message); - - return $pendingAgentTask; + public function createEmbeddings(string $input, array $extraAgentArgs = []): EmbeddingResponse + { + throw new NotImplementedException('Claude does not support embedding creation.'); } /** @@ -47,8 +33,22 @@ public function handleCompletion( ); } - public function createEmbeddings(string $input, array $extraAgentArgs = []): EmbeddingResponse - { - throw new NotImplementedException('Claude does not support embedding creation.'); + /** + * {@inheritdoc} + */ + public function handlePendingAgentTaskCompletion( + PendingAgentTask $pendingAgentTask + ): PendingAgentTask { + + $claudeAIConnector = new ClaudeAIConnector; + $message = $claudeAIConnector->doCompletionRequest( + prompt: $pendingAgentTask->currentIteration()->getPromptChain(), + tools: $pendingAgentTask->tools(), + extraAgentArgs: $pendingAgentTask->currentIteration()->getExtraAgentArgs() + ); + + $pendingAgentTask->currentIteration()->setResponse($message); + + return $pendingAgentTask; } } diff --git a/src/Integrations/Connectors/Claude/Requests/ChatRequest.php b/src/Integrations/Connectors/Claude/Requests/ChatRequest.php index 6af3c27..d49f098 100644 --- a/src/Integrations/Connectors/Claude/Requests/ChatRequest.php +++ b/src/Integrations/Connectors/Claude/Requests/ChatRequest.php @@ -9,34 +9,53 @@ use Saloon\Traits\Body\HasJsonBody; use UseTheFork\Synapse\Constants\Role; use UseTheFork\Synapse\Enums\FinishReason; -use UseTheFork\Synapse\Enums\ResponseType; use UseTheFork\Synapse\ValueObject\Message; -use UseTheFork\Synapse\ValueObject\Response as IntegrationResponse; -use UseTheFork\Synapse\ValueObject\ToolCall; class ChatRequest extends Request implements HasBody { use HasJsonBody; - private string $system = ''; - /** * The HTTP method */ protected Method $method = Method::POST; + private string $system = ''; + public function __construct( public readonly array $prompt, public readonly array $tools, public readonly array $extraAgentArgs = [] ) {} - /** - * The endpoint - */ - public function resolveEndpoint(): string + public function createDtoFromResponse(Response $response): Message { - return '/messages'; + $data = $response->array(); + $message = []; + + $message['role'] = 'assistant'; + $message['finish_reason'] = $this->convertResponseType($data['stop_reason']) ?? ''; + foreach ($data['content'] as $choice) { + + if ($choice['type'] === 'text') { + $message['content'] = $choice['text']; + } else { + $message['tool_call_id'] = $choice['id']; + $message['tool_name'] = $choice['name']; + $message['tool_arguments'] = json_encode($choice['input']); + $message['role'] = Role::TOOL; + } + } + + return Message::make($message); + } + + private function convertResponseType($stopReason): string + { + return match ($stopReason) { + 'tool_use' => FinishReason::TOOL_CALL->value, + default => FinishReason::STOP->value, + }; } /** @@ -64,17 +83,6 @@ public function defaultBody(): array } - private function formatTools(): array - { - return array_values(array_map(function (array $tool) { - $claudeTool = $tool['definition']['function']; - $claudeTool['input_schema'] = $claudeTool['parameters']; - unset($claudeTool['parameters']); - - return $claudeTool; - }, $this->tools)); - } - private function formatMessages(): array { @@ -103,27 +111,6 @@ private function formatMessages(): array return $payload->values()->toArray(); } - private function formatAssistantMessage(Message $message): array - { - $message = $message->toArray(); - - $content[] = ['type' => 'text', 'text' => $message['content']]; - - if (! empty($message['tool_call_id'])) { - $content[] = [ - 'type' => 'tool_use', - 'id' => $message['tool_call_id'], - 'name' => $message['tool_name'], - 'input' => json_decode($message['tool_arguments'], true), - ]; - } - - return [ - 'role' => 'assistant', - 'content' => $content, - ]; - } - private function formatToolMessage(Message $message): array { $message = $message->toArray(); @@ -158,34 +145,43 @@ private function formatToolMessage(Message $message): array return $payload; } - private function convertResponseType($stopReason): string - { - return match ($stopReason) { - 'tool_use' => FinishReason::TOOL_CALL->value, - default => FinishReason::STOP->value, - }; - } - - public function createDtoFromResponse(Response $response): Message + private function formatAssistantMessage(Message $message): array { - $data = $response->array(); - $message = []; + $message = $message->toArray(); - $message['role'] = 'assistant'; - $message['finish_reason'] = $this->convertResponseType($data['stop_reason']) ?? ''; - foreach ($data['content'] as $choice) { + $content[] = ['type' => 'text', 'text' => $message['content']]; - if ($choice['type'] === 'text') { - $message['content'] = $choice['text']; - } else { - $message['tool_call_id'] = $choice['id']; - $message['tool_name'] = $choice['name']; - $message['tool_arguments'] = json_encode($choice['input']); - $message['role'] = Role::TOOL; - } + if (! empty($message['tool_call_id'])) { + $content[] = [ + 'type' => 'tool_use', + 'id' => $message['tool_call_id'], + 'name' => $message['tool_name'], + 'input' => json_decode($message['tool_arguments'], true), + ]; } + return [ + 'role' => 'assistant', + 'content' => $content, + ]; + } - return Message::make($message); + private function formatTools(): array + { + return array_values(array_map(function (array $tool) { + $claudeTool = $tool['definition']['function']; + $claudeTool['input_schema'] = $claudeTool['parameters']; + unset($claudeTool['parameters']); + + return $claudeTool; + }, $this->tools)); + } + + /** + * The endpoint + */ + public function resolveEndpoint(): string + { + return '/messages'; } } diff --git a/src/Integrations/Connectors/Ollama/OllamaAIConnector.php b/src/Integrations/Connectors/Ollama/OllamaAIConnector.php new file mode 100644 index 0000000..a114398 --- /dev/null +++ b/src/Integrations/Connectors/Ollama/OllamaAIConnector.php @@ -0,0 +1,60 @@ +send(new EmbeddingsRequest($input, $extraAgentArgs))->dto(); + } + + /** + * Handles the request to generate a chat response. + * + * @param array $prompt The chat prompt. + * @param array $tools Tools the agent has access to. + * @param array $extraAgentArgs Extra arguments to be passed to the agent. + * @return Message The response from the chat request. + * + * @throws FatalRequestException + * @throws RequestException + */ + public function doCompletionRequest( + array $prompt, + array $tools = [], + array $extraAgentArgs = [] + ): Message { + return $this->send(new ChatRequest($prompt, $tools, $extraAgentArgs))->dto(); + } + + /** + * The Base URL of the API + */ + public function resolveBaseUrl(): string + { + return config('synapse.integrations.ollama.base_url') . "/api"; + } + +} diff --git a/src/Integrations/Connectors/Ollama/Requests/ChatRequest.php b/src/Integrations/Connectors/Ollama/Requests/ChatRequest.php new file mode 100644 index 0000000..d7b6011 --- /dev/null +++ b/src/Integrations/Connectors/Ollama/Requests/ChatRequest.php @@ -0,0 +1,170 @@ +array(); + $message = []; + + $message['role'] = 'assistant'; + + if(empty($data['message']['tool_calls'])){ + $message['finish_reason'] = FinishReason::STOP->value; + $message['content'] = $data['message']['content']; + } else { + // Tool call + $message['finish_reason'] = FinishReason::TOOL_CALL->value; + $message['content'] = ''; + + # To keep tool call ID's the same in our cache we create a md5 hash of the tool call and use that as the ID + $message['tool_call_id'] = md5(json_encode($data['message']['tool_calls'][0])); + $message['tool_name'] = $data['message']['tool_calls'][0]['function']['name']; + $message['tool_arguments'] = json_encode($data['message']['tool_calls'][0]['function']['arguments']); + $message['role'] = Role::TOOL; + } + + return Message::make($message); + } + + /** + * Data to be sent in the body of the request + */ + public function defaultBody(): array + { + $model = config('synapse.integrations.ollama.chat_model'); + + $payload = [ + 'model' => $model, + 'messages' => $this->formatMessages(), + 'stream' => false, + 'raw' => true, + ]; + +// if(!empty($this->system)){ +// $payload['system'] = $this->system; +// } + + if ($this->tools !== []) { + $payload['tools'] = $this->formatTools(); + } + + return [ + ...$payload, + ...$this->extraAgentArgs, + ]; + + } + + private function formatMessages(): array + { + + $payload = collect(); + foreach ($this->prompt as $message) { + switch ($message->role()) { + case Role::SYSTEM: + # O seems to do better when the 'system' prompt starts as a user prompt... I'll take it. + $payload->push([ + 'role' => 'user', + 'content' => $message->content(), + ]); + break; + case Role::TOOL: + $toolPayload = $this->formatToolMessage($message); + $payload->push(...$toolPayload); + break; + default: + $payload->push([ + 'role' => $message->role(), + 'content' => $message->content(), + ]); + break; + } + } + + return $payload->values()->toArray(); + } + + private function formatToolMessage(Message $message): array + { + $message = $message->toArray(); + + // Claude requires tool responses to be multipart agent and user responses. + $payload[] = [ + 'role' => 'assistant', + 'content' => $message['content'], + 'tool_calls' => [ + [ + 'id' => $message['tool_call_id'], + 'type' => 'function', + 'function' => [ + 'name' => $message['tool_name'], + 'arguments' => json_decode($message['tool_arguments'], true), + ], + ] + ], + ]; + $payload[] = [ + 'role' => 'tool', + 'content' => $message['tool_content'], + ]; + + return $payload; + } + + private function formatTools(): array + { + $formattedTools = []; + foreach ($this->tools as $key => $tool) { + + $tool = $tool['definition']; + + if (is_array($tool) && isset($tool['function'])) { + $formattedTools[] = [ + 'type' => 'function', + 'function' => [ + 'name' => $tool['function']['name'] ?? $key, + 'description' => $tool['function']['description'] ?? '', + 'parameters' => $tool['function']['parameters'] ?? [], + ], + ]; + } + } + + return $formattedTools; + + } + + /** + * The endpoint + */ + public function resolveEndpoint(): string + { + return '/chat'; + } +} diff --git a/src/Integrations/Connectors/Ollama/Requests/EmbeddingsRequest.php b/src/Integrations/Connectors/Ollama/Requests/EmbeddingsRequest.php new file mode 100644 index 0000000..ed90937 --- /dev/null +++ b/src/Integrations/Connectors/Ollama/Requests/EmbeddingsRequest.php @@ -0,0 +1,47 @@ +array(); + + return EmbeddingResponse::makeOrNull($data); + } + + public function defaultBody(): array + { + $model = config('synapse.integrations.ollama.embedding_model'); + + return [ + 'model' => $model, + 'input' => $this->input, + ...$this->extraAgentArgs, + ]; + } + + public function resolveEndpoint(): string + { + return '/embed'; + } +} diff --git a/src/Integrations/OllamaIntegration.php b/src/Integrations/OllamaIntegration.php new file mode 100644 index 0000000..0252ca0 --- /dev/null +++ b/src/Integrations/OllamaIntegration.php @@ -0,0 +1,54 @@ +doCompletionRequest( + prompt: [$message], + extraAgentArgs: $extraAgentArgs + ); + } + + /** + * {@inheritdoc} + */ + public function handlePendingAgentTaskCompletion( + PendingAgentTask $pendingAgentTask + ): PendingAgentTask { + + $ollamaAIConnector = new OllamaAIConnector; + $message = $ollamaAIConnector->doCompletionRequest( + prompt: $pendingAgentTask->currentIteration()->getPromptChain(), + tools: $pendingAgentTask->tools(), + extraAgentArgs: $pendingAgentTask->currentIteration()->getExtraAgentArgs() + ); + + $pendingAgentTask->currentIteration()->setResponse($message); + + return $pendingAgentTask; + } +} diff --git a/src/Repositories/ArrayStore.php b/src/Repositories/ArrayStore.php new file mode 100644 index 0000000..52b967a --- /dev/null +++ b/src/Repositories/ArrayStore.php @@ -0,0 +1,121 @@ + + */ + protected array $data = []; + + /** + * Constructor + * + * @param array $data + */ + public function __construct(array $data = []) + { + $this->data = $data; + } + + /** + * Add an item to the repository. + * + * @return $this + */ + public function add(string $key, mixed $value): static + { + $this->data[$key] = Helpers::value($value); + + return $this; + } + + /** + * Retrieve a single item. + */ + public function get(string $key, mixed $default = null): mixed + { + return $this->all()[$key] ?? $default; + } + + /** + * Retrieve all the items. + * + * @return array + */ + public function all(): array + { + return $this->data; + } + + /** + * Determine if the store is not empty + * + * + * @phpstan-assert-if-true non-empty-array $this->data + */ + public function isNotEmpty(): bool + { + return ! $this->isEmpty(); + } + + /** + * Determine if the store is empty + * + * + * @phpstan-assert-if-false non-empty-array $this->data + */ + public function isEmpty(): bool + { + return empty($this->data); + } + + /** + * Merge in other arrays. + * + * @param array ...$arrays + * @return $this + */ + public function merge(array ...$arrays): static + { + $this->data = array_merge($this->data, ...$arrays); + + return $this; + } + + /** + * Remove an item from the store. + * + * @return $this + */ + public function remove(string $key): static + { + unset($this->data[$key]); + + return $this; + } + + /** + * Overwrite the entire repository. + * + * @param array $data + * @return $this + */ + public function set(array $data): static + { + $this->data = $data; + + return $this; + } + } diff --git a/src/Traits/Agent/ValidatesOutputSchema.php b/src/Traits/Agent/ValidatesOutputSchema.php index 522cc16..fbefb8a 100644 --- a/src/Traits/Agent/ValidatesOutputSchema.php +++ b/src/Traits/Agent/ValidatesOutputSchema.php @@ -41,7 +41,6 @@ public function bootValidatesOutputSchema(): void public function addOutputSchema(PendingAgentTask $pendingAgentTask): PendingAgentTask { $pendingAgentTask->addInput('outputSchema', $this->getOutputSchema()); - return $pendingAgentTask; } @@ -116,7 +115,7 @@ public function doValidateOutputSchema(PendingAgentTask $pendingAgentTask): Pend $errorsFlat = $errorsFlat->implode(PHP_EOL); $errorsAsString = $errorsFlat . "\n\n"; } - $response = $this->doRevalidate($errorsAsString); + $response = $this->doRevalidate($response, $errorsAsString); //since all integrations return a Message value object we need to grab the content $response = $response->currentIteration()->getResponse()->content(); @@ -134,12 +133,25 @@ public function doValidateOutputSchema(PendingAgentTask $pendingAgentTask): Pend */ protected function parseResponse(string $input): ?array { - return json_decode( + + # we attempt to Decode the Json in a few ways. It's best to give all models a chance before failing. + $jsonFormat = json_decode( str($input)->replace([ '```json', '```', ], '')->toString(), TRUE ); + + if(!empty($jsonFormat)){ + return $jsonFormat; + } + + return json_decode( + str($input)->replace([ + '```', + '```', + ], '')->toString(), TRUE + ); } /** @@ -151,24 +163,27 @@ protected function parseResponse(string $input): ?array * * @throws Throwable */ - protected function doRevalidate(string $errors = ''): PendingAgentTask + protected function doRevalidate(string $response, string $errors = ''): PendingAgentTask { $prompt = view('synapse::Prompts.ReValidateResponsePrompt', [ - 'outputRules' => $this->getOutputSchema(), + 'outputSchema' => $this->getOutputSchema(), + 'lastResponse' => $response, 'errors' => $errors ])->render(); - $prompt = Message::make([ + $validationPrompt = Message::make([ 'role' => 'user', 'content' => $prompt, ]); + //We get the whole conversation so far but append a validation message $promptChain = $this->pendingAgentTask->currentIteration()->getPromptChain(); + $this->pendingAgentTask->currentIteration()->setPromptChain([ ...$promptChain, - $prompt + $validationPrompt ]); // Create the Chat request we will be sending. diff --git a/src/Traits/Conditionable.php b/src/Traits/Conditionable.php new file mode 100644 index 0000000..7eb4417 --- /dev/null +++ b/src/Traits/Conditionable.php @@ -0,0 +1,60 @@ +config ??= new ArrayStore($this->defaultConfig()); + } + + /** + * Default Config + * + * @return array + */ + protected function defaultConfig(): array + { + return []; + } + } diff --git a/tests/AgentChains/RatAgentChainTest.php b/tests/AgentChains/RatAgentChainTest.php new file mode 100644 index 0000000..1007064 --- /dev/null +++ b/tests/AgentChains/RatAgentChainTest.php @@ -0,0 +1,43 @@ + function (PendingRequest $pendingRequest): \Saloon\Http\Faking\Fixture { + $hash = md5(json_encode($pendingRequest->body()->get('messages'))); + + return MockResponse::fixture("AgentChains/RatAgentChain-{$hash}"); + }, + ]); + + $agentChain = AgentChain::make([ + new RatDraftAgent, + new RatSplitAnswerAgent, + ])->persistInputs([ + 'question' => 'how so I improve my heart health?', + 'number_of_paragraphs' => '5', + ]); + + $message = $agentChain->handle([]); + $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}"; + } + +}); diff --git a/tests/Agents/ChatRephraseAgentTest.php b/tests/Agents/ChatRephraseAgentTest.php index 5041931..3d47e8a 100644 --- a/tests/Agents/ChatRephraseAgentTest.php +++ b/tests/Agents/ChatRephraseAgentTest.php @@ -38,5 +38,5 @@ expect($agentResponseArray['content'])->toBeArray() ->and($agentResponseArray['content'])->toHaveKey('standalone_question') - ->and($agentResponseArray['content']['standalone_question'] == 'How can one improve heart health?')->toBeTrue(); + ->and($agentResponseArray['content']['standalone_question'])->toBe('How can one improve heart health through gym activities?'); }); diff --git a/tests/Agents/SQLToolAgentTest.php b/tests/Agents/SQLToolAgentTest.php index 9e908d4..ed8f0ed 100644 --- a/tests/Agents/SQLToolAgentTest.php +++ b/tests/Agents/SQLToolAgentTest.php @@ -2,49 +2,48 @@ declare(strict_types=1); - use Saloon\Http\Faking\MockClient; - use Saloon\Http\Faking\MockResponse; - use Saloon\Http\PendingRequest; - use UseTheFork\Synapse\Agents\SQLToolAgent; - use UseTheFork\Synapse\Integrations\Connectors\OpenAI\Requests\ChatRequest; - use Workbench\App\Models\Organization; - - it('can run the SQL Tool Agent.', function (): void { - - - for ($i = 0; $i < 100; $i++){ - $org = new Organization(); - $org->fill([ - 'name' => "Foo - {$i}", - 'domain' => "Foo_{$i}.com", - 'country_code' => 'USA', - 'email' => 'foo@bar.com', - 'city' => 'hartford', - 'status' => 'operating', - 'short_description' => 'lorem ipsum', - 'num_funding_rounds' => 5, - 'total_funding_usd' => 1000000, - 'founded_on' => '2024-03-01', - ]); - $org->save(); - } - - for ($i = 0; $i < 100; $i++){ - $org = new Organization(); - $org->fill([ - 'name' => "Baz - {$i}", - 'domain' => "Baz_{$i}.com", - 'country_code' => 'USA', - 'email' => 'baz@bar.com', - 'city' => 'hartford', - 'status' => 'closed', - 'short_description' => 'lorem ipsum', - 'num_funding_rounds' => 5, - 'total_funding_usd' => 1000000, - 'founded_on' => '2024-03-01', - ]); - $org->save(); - } +use Saloon\Http\Faking\MockClient; +use Saloon\Http\Faking\MockResponse; +use Saloon\Http\PendingRequest; +use UseTheFork\Synapse\Agents\SQLToolAgent; +use UseTheFork\Synapse\Integrations\Connectors\OpenAI\Requests\ChatRequest; +use Workbench\App\Models\Organization; + +it('can run the SQL Tool Agent.', function (): void { + + for ($i = 0; $i < 100; $i++) { + $org = new Organization; + $org->fill([ + 'name' => "Foo - {$i}", + 'domain' => "Foo_{$i}.com", + 'country_code' => 'USA', + 'email' => 'foo@bar.com', + 'city' => 'hartford', + 'status' => 'operating', + 'short_description' => 'lorem ipsum', + 'num_funding_rounds' => 5, + 'total_funding_usd' => 1000000, + 'founded_on' => '2024-03-01', + ]); + $org->save(); + } + + for ($i = 0; $i < 100; $i++) { + $org = new Organization; + $org->fill([ + 'name' => "Baz - {$i}", + 'domain' => "Baz_{$i}.com", + 'country_code' => 'USA', + 'email' => 'baz@bar.com', + 'city' => 'hartford', + 'status' => 'closed', + 'short_description' => 'lorem ipsum', + 'num_funding_rounds' => 5, + 'total_funding_usd' => 1000000, + 'founded_on' => '2024-03-01', + ]); + $org->save(); + } MockClient::global([ ChatRequest::class => function (PendingRequest $pendingRequest): \Saloon\Http\Faking\Fixture { @@ -59,6 +58,6 @@ $agentResponseArray = $message->toArray(); expect($agentResponseArray['content'])->toBeArray() - ->and($agentResponseArray['content'])->toHaveKey('answer') - ->and($agentResponseArray['content']['answer'])->toContain('There are 100 operating organizations and the average number of funding rounds for them is 5.'); + ->and($agentResponseArray['content'])->toHaveKey('answer') + ->and($agentResponseArray['content']['answer'])->toContain('100', '5'); }); diff --git a/tests/Fixtures/Saloon/AgentChains/RatAgentChain-0dac52efdcd81f0dae4be83cc7dd9134.json b/tests/Fixtures/Saloon/AgentChains/RatAgentChain-0dac52efdcd81f0dae4be83cc7dd9134.json new file mode 100644 index 0000000..c0b7531 --- /dev/null +++ b/tests/Fixtures/Saloon/AgentChains/RatAgentChain-0dac52efdcd81f0dae4be83cc7dd9134.json @@ -0,0 +1,10 @@ +{ + "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 new file mode 100644 index 0000000..a430148 --- /dev/null +++ b/tests/Fixtures/Saloon/AgentChains/RatAgentChain-23b86031e4743be2f58c64dd85d11f40.json @@ -0,0 +1,31 @@ +{ + "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 new file mode 100644 index 0000000..a4719f0 --- /dev/null +++ b/tests/Fixtures/Saloon/AgentChains/RatAgentChain-3a4abc7b397c195a952d147f5999c932.json @@ -0,0 +1,31 @@ +{ + "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 new file mode 100644 index 0000000..a5372fd --- /dev/null +++ b/tests/Fixtures/Saloon/AgentChains/RatAgentChain-3d6768be2549ac5e1a0e44d2ed1eb2c1.json @@ -0,0 +1,31 @@ +{ + "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 new file mode 100644 index 0000000..6d6dd98 --- /dev/null +++ b/tests/Fixtures/Saloon/AgentChains/RatAgentChain-7e62e7ca508c58a7dd52e9451a68d9b2.json @@ -0,0 +1,31 @@ +{ + "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 new file mode 100644 index 0000000..ede9289 --- /dev/null +++ b/tests/Fixtures/Saloon/AgentChains/RatAgentChain-9ce86b41e54066cf052469d1d46c848d.json @@ -0,0 +1,10 @@ +{ + "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 new file mode 100644 index 0000000..0d8758f --- /dev/null +++ b/tests/Fixtures/Saloon/AgentChains/RatAgentChain-c8b871f5b66ceee6cdd6a4f41ca4809e.json @@ -0,0 +1,10 @@ +{ + "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 new file mode 100644 index 0000000..89a5763 --- /dev/null +++ b/tests/Fixtures/Saloon/AgentChains/RatAgentChain-e6be3b2a969ae75116175e3c039cc2f2.json @@ -0,0 +1,11 @@ +{ + "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/Agents/ChatRephraseAgent-d53f1768c34d5c32774aa924150302a0.json b/tests/Fixtures/Saloon/Agents/ChatRephraseAgent-d53f1768c34d5c32774aa924150302a0.json new file mode 100644 index 0000000..bb11931 --- /dev/null +++ b/tests/Fixtures/Saloon/Agents/ChatRephraseAgent-d53f1768c34d5c32774aa924150302a0.json @@ -0,0 +1,31 @@ +{ + "statusCode": 200, + "headers": { + "Date": "Tue, 22 Oct 2024 01:28:22 GMT", + "Content-Type": "application/json", + "Content-Length": "725", + "Connection": "keep-alive", + "access-control-expose-headers": "X-Request-ID", + "openai-organization": "user-5hvzt3x5aqwr0picqhxifwl8", + "openai-processing-ms": "858", + "openai-version": "2020-10-01", + "x-ratelimit-limit-requests": "10000", + "x-ratelimit-limit-tokens": "2000000", + "x-ratelimit-remaining-requests": "9999", + "x-ratelimit-remaining-tokens": "1999656", + "x-ratelimit-reset-requests": "6ms", + "x-ratelimit-reset-tokens": "10ms", + "x-request-id": "req_92c7ea6e5c16152c129ec11fb2b5e172", + "strict-transport-security": "max-age=31536000; includeSubDomains; preload", + "CF-Cache-Status": "DYNAMIC", + "Set-Cookie": [ + "__cf_bm=hPO2vobWRuUv61gTCjPAtKKvr39Q1OnxRrf10QS4M7k-1729560502-1.0.1.1-JBD.hk0I9T3n5HJYqlEur46jtDmEFNfy0XU9XtC1Q00Aba3nkBLLxYwL6cv1LgwylMp1jmDiblV7f4lIWDCBBw; path=/; expires=Tue, 22-Oct-24 01:58:22 GMT; domain=.api.openai.com; HttpOnly; Secure; SameSite=None", + "_cfuvid=8uibqfRpr59vivboYsljTlOiDpo5lseCEddnNsMZR_s-1729560502072-0.0.1.1-604800000; path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None" + ], + "X-Content-Type-Options": "nosniff", + "Server": "cloudflare", + "CF-RAY": "8d65b5cbdeef8c9c-EWR", + "alt-svc": "h3=\":443\"; ma=86400" + }, + "data": "{\n \"id\": \"chatcmpl-AKxz3P5k2zvdYdRlwudwl1TUpr6hK\",\n \"object\": \"chat.completion\",\n \"created\": 1729560501,\n \"model\": \"gpt-4-turbo-2024-04-09\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"{\\n \\\"standalone_question\\\": \\\"How can one improve heart health through gym activities?\\\"\\n}\\n```\",\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 272,\n \"completion_tokens\": 20,\n \"total_tokens\": 292,\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/Agents/MultiQueryRetrieverAgent-d54e72acfb8432e3c4ce48cab4f69391.json b/tests/Fixtures/Saloon/Agents/MultiQueryRetrieverAgent-d54e72acfb8432e3c4ce48cab4f69391.json new file mode 100644 index 0000000..1bfa82c --- /dev/null +++ b/tests/Fixtures/Saloon/Agents/MultiQueryRetrieverAgent-d54e72acfb8432e3c4ce48cab4f69391.json @@ -0,0 +1,31 @@ +{ + "statusCode": 200, + "headers": { + "Date": "Tue, 22 Oct 2024 01:28:25 GMT", + "Content-Type": "application\/json", + "Content-Length": "1057", + "Connection": "keep-alive", + "access-control-expose-headers": "X-Request-ID", + "openai-organization": "user-5hvzt3x5aqwr0picqhxifwl8", + "openai-processing-ms": "2499", + "openai-version": "2020-10-01", + "x-ratelimit-limit-requests": "10000", + "x-ratelimit-limit-tokens": "2000000", + "x-ratelimit-remaining-requests": "9999", + "x-ratelimit-remaining-tokens": "1999773", + "x-ratelimit-reset-requests": "6ms", + "x-ratelimit-reset-tokens": "6ms", + "x-request-id": "req_c2003d4df94f5d76587d213b8e2c6019", + "strict-transport-security": "max-age=31536000; includeSubDomains; preload", + "CF-Cache-Status": "DYNAMIC", + "Set-Cookie": [ + "__cf_bm=PYizbeamYDO0AtQDPhtzpVN1Zn._kgqTMunqMSZ7skg-1729560505-1.0.1.1-wXqtr1GxAEswcMzw51eNuZpN.Lnii_6xliCDPdfWV87pExEOJ81H2gGVlr.fsw2dwdoTzM9lAzfQeklTfe19mQ; path=\/; expires=Tue, 22-Oct-24 01:58:25 GMT; domain=.api.openai.com; HttpOnly; Secure; SameSite=None", + "_cfuvid=7anOzpNsNSahAxndBxMCshFUOqEqngNywz1TRH5Ogis-1729560505780-0.0.1.1-604800000; path=\/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None" + ], + "X-Content-Type-Options": "nosniff", + "Server": "cloudflare", + "CF-RAY": "8d65b5d8ae9842a5-EWR", + "alt-svc": "h3=\":443\"; ma=86400" + }, + "data": "{\n \"id\": \"chatcmpl-AKxz5Q8DNUTvqYVNMoCkbfKvQ4dId\",\n \"object\": \"chat.completion\",\n \"created\": 1729560503,\n \"model\": \"gpt-4-turbo-2024-04-09\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"{\\n \\\"answer\\\": [\\n \\\"Which exercise routines at the gym are beneficial for cardiovascular health?\\\",\\n \\\"What are the best gym workouts to improve heart function?\\\",\\n \\\"Can you suggest some cardio exercises at the gym for heart health?\\\",\\n \\\"What types of gym activities help in strengthening the heart?\\\",\\n \\\"Which gym exercises are most effective for enhancing cardiac health?\\\"\\n ]\\n}\",\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 175,\n \"completion_tokens\": 77,\n \"total_tokens\": 252,\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/Agents/SQLToolAgent-0f2cbb046d14f10babf198d5839a56ee.json b/tests/Fixtures/Saloon/Agents/SQLToolAgent-0f2cbb046d14f10babf198d5839a56ee.json new file mode 100644 index 0000000..9b55d88 --- /dev/null +++ b/tests/Fixtures/Saloon/Agents/SQLToolAgent-0f2cbb046d14f10babf198d5839a56ee.json @@ -0,0 +1,31 @@ +{ + "statusCode": 200, + "headers": { + "Date": "Tue, 22 Oct 2024 01:28:28 GMT", + "Content-Type": "application/json", + "Content-Length": "897", + "Connection": "keep-alive", + "access-control-expose-headers": "X-Request-ID", + "openai-organization": "user-5hvzt3x5aqwr0picqhxifwl8", + "openai-processing-ms": "796", + "openai-version": "2020-10-01", + "x-ratelimit-limit-requests": "10000", + "x-ratelimit-limit-tokens": "2000000", + "x-ratelimit-remaining-requests": "9999", + "x-ratelimit-remaining-tokens": "1999680", + "x-ratelimit-reset-requests": "6ms", + "x-ratelimit-reset-tokens": "9ms", + "x-request-id": "req_502461abc2d9db282ec9184222c3ee8d", + "strict-transport-security": "max-age=31536000; includeSubDomains; preload", + "CF-Cache-Status": "DYNAMIC", + "Set-Cookie": [ + "__cf_bm=JXmtqFpn2KYYRTuq2_HsolRbSBmUDuJWEtgNNQCXUcQ-1729560508-1.0.1.1-.a91ln2AQjtDtDE_VpUda3KFAug2G0nNgnTcoa04wlWm0tdHFKG795ys6.i8SfNUlmLLfpDF9ETjm7C_KZb85A; path=/; expires=Tue, 22-Oct-24 01:58:28 GMT; domain=.api.openai.com; HttpOnly; Secure; SameSite=None", + "_cfuvid=UQgb.hxkKSJoVq2Y2gjp5xKYJqhiBkIJshOsRnhaRaY-1729560508026-0.0.1.1-604800000; path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None" + ], + "X-Content-Type-Options": "nosniff", + "Server": "cloudflare", + "CF-RAY": "8d65b5ee1c2a7cf6-EWR", + "alt-svc": "h3=\":443\"; ma=86400" + }, + "data": "{\n \"id\": \"chatcmpl-AKxz9pLzXNEz4PxkGZALXMXcRbAc6\",\n \"object\": \"chat.completion\",\n \"created\": 1729560507,\n \"model\": \"gpt-4-turbo-2024-04-09\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": null,\n \"tool_calls\": [\n {\n \"id\": \"call_UmSgwmAuST5mlWbwTbnyT499\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"list_s_q_l_database_tool\",\n \"arguments\": \"{}\"\n }\n }\n ],\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"tool_calls\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 423,\n \"completion_tokens\": 14,\n \"total_tokens\": 437,\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/Agents/SQLToolAgent-1f623066a9197d1a4b395fa6a7079da3.json b/tests/Fixtures/Saloon/Agents/SQLToolAgent-1f623066a9197d1a4b395fa6a7079da3.json new file mode 100644 index 0000000..1e62479 --- /dev/null +++ b/tests/Fixtures/Saloon/Agents/SQLToolAgent-1f623066a9197d1a4b395fa6a7079da3.json @@ -0,0 +1,31 @@ +{ + "statusCode": 200, + "headers": { + "Date": "Tue, 22 Oct 2024 01:28:31 GMT", + "Content-Type": "application/json", + "Content-Length": "925", + "Connection": "keep-alive", + "access-control-expose-headers": "X-Request-ID", + "openai-organization": "user-5hvzt3x5aqwr0picqhxifwl8", + "openai-processing-ms": "833", + "openai-version": "2020-10-01", + "x-ratelimit-limit-requests": "10000", + "x-ratelimit-limit-tokens": "2000000", + "x-ratelimit-remaining-requests": "9999", + "x-ratelimit-remaining-tokens": "1999577", + "x-ratelimit-reset-requests": "6ms", + "x-ratelimit-reset-tokens": "12ms", + "x-request-id": "req_11b9677b9ae15f3a78a540efc873ea3e", + "strict-transport-security": "max-age=31536000; includeSubDomains; preload", + "CF-Cache-Status": "DYNAMIC", + "Set-Cookie": [ + "__cf_bm=QGlqwaczD6k0rsD1TwdBy4dLtLIHUpv5nUumNVvX720-1729560511-1.0.1.1-UHPXa5jXvG9Hag3ztcEsBmJeaATBM.KKJ2.0L_5Y4YaidaXcL48ZPurCLqGox7ZytfmIt9NkMVblJW3Lhrt5kA; path=/; expires=Tue, 22-Oct-24 01:58:31 GMT; domain=.api.openai.com; HttpOnly; Secure; SameSite=None", + "_cfuvid=qoHc98fgxNE4IvtxmiWkTyJBFwiM629PEtjuVk1WiQo-1729560511656-0.0.1.1-604800000; path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None" + ], + "X-Content-Type-Options": "nosniff", + "Server": "cloudflare", + "CF-RAY": "8d65b607cd398ccd-EWR", + "alt-svc": "h3=\":443\"; ma=86400" + }, + "data": "{\n \"id\": \"chatcmpl-AKxzCTjYgxnslLxs7ywdHc5M5HHC6\",\n \"object\": \"chat.completion\",\n \"created\": 1729560510,\n \"model\": \"gpt-4-turbo-2024-04-09\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": null,\n \"tool_calls\": [\n {\n \"id\": \"call_mRECkNXbFwzmdokaTUYG3ufG\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"info_s_q_l_database_tool\",\n \"arguments\": \"{\\\"tables\\\":\\\"organizations\\\"}\"\n }\n }\n ],\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"tool_calls\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 602,\n \"completion_tokens\": 18,\n \"total_tokens\": 620,\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/Agents/SQLToolAgent-aea323a5832b8415f679133f693e2b13.json b/tests/Fixtures/Saloon/Agents/SQLToolAgent-aea323a5832b8415f679133f693e2b13.json new file mode 100644 index 0000000..7db2297 --- /dev/null +++ b/tests/Fixtures/Saloon/Agents/SQLToolAgent-aea323a5832b8415f679133f693e2b13.json @@ -0,0 +1,31 @@ +{ + "statusCode": 200, + "headers": { + "Date": "Tue, 22 Oct 2024 01:28:36 GMT", + "Content-Type": "application\/json", + "Content-Length": "758", + "Connection": "keep-alive", + "access-control-expose-headers": "X-Request-ID", + "openai-organization": "user-5hvzt3x5aqwr0picqhxifwl8", + "openai-processing-ms": "2097", + "openai-version": "2020-10-01", + "x-ratelimit-limit-requests": "10000", + "x-ratelimit-limit-tokens": "2000000", + "x-ratelimit-remaining-requests": "9999", + "x-ratelimit-remaining-tokens": "1998911", + "x-ratelimit-reset-requests": "6ms", + "x-ratelimit-reset-tokens": "32ms", + "x-request-id": "req_4fce149cbcb9d6e3df26e6378ea6f79d", + "strict-transport-security": "max-age=31536000; includeSubDomains; preload", + "CF-Cache-Status": "DYNAMIC", + "Set-Cookie": [ + "__cf_bm=GEUlC5D1qBJOQxhSRrIXSKecbBwRJWCVSiEaZLy0sow-1729560516-1.0.1.1-OhrdDkGPPQ2.2Ux5kfiD7c3zZhuLLCt7Nx.YzNSKE51AbJwTjPWAc8YPW_iztbsBosyD_J1gfpZ.pOK2yM6Ehg; path=\/; expires=Tue, 22-Oct-24 01:58:36 GMT; domain=.api.openai.com; HttpOnly; Secure; SameSite=None", + "_cfuvid=FNQjNOID.tCjMYC7IoA_jeQQysF9sKoyOwn0_NBC3l8-1729560516806-0.0.1.1-604800000; path=\/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None" + ], + "X-Content-Type-Options": "nosniff", + "Server": "cloudflare", + "CF-RAY": "8d65b6201d410cd9-EWR", + "alt-svc": "h3=\":443\"; ma=86400" + }, + "data": "{\n \"id\": \"chatcmpl-AKxzGkfig1506CY7sOwi4eJVTLgUJ\",\n \"object\": \"chat.completion\",\n \"created\": 1729560514,\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\\\": \\\"{\\\\n \\\\\\\"total_operating_organizations\\\\\\\": 100,\\\\n \\\\\\\"average_funding_rounds\\\\\\\": 5\\\\n}\\\"\\n}\\n```\",\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 1404,\n \"completion_tokens\": 38,\n \"total_tokens\": 1442,\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/Agents/SQLToolAgent-dbbeef79e6e45bbca928834e33282bd5.json b/tests/Fixtures/Saloon/Agents/SQLToolAgent-dbbeef79e6e45bbca928834e33282bd5.json new file mode 100644 index 0000000..f43d7e4 --- /dev/null +++ b/tests/Fixtures/Saloon/Agents/SQLToolAgent-dbbeef79e6e45bbca928834e33282bd5.json @@ -0,0 +1,31 @@ +{ + "statusCode": 200, + "headers": { + "Date": "Tue, 22 Oct 2024 01:28:30 GMT", + "Content-Type": "application\/json", + "Content-Length": "1054", + "Connection": "keep-alive", + "access-control-expose-headers": "X-Request-ID", + "openai-organization": "user-5hvzt3x5aqwr0picqhxifwl8", + "openai-processing-ms": "2048", + "openai-version": "2020-10-01", + "x-ratelimit-limit-requests": "10000", + "x-ratelimit-limit-tokens": "2000000", + "x-ratelimit-remaining-requests": "9999", + "x-ratelimit-remaining-tokens": "1999638", + "x-ratelimit-reset-requests": "6ms", + "x-ratelimit-reset-tokens": "10ms", + "x-request-id": "req_c999edb687ad626728dda2d3855e596a", + "strict-transport-security": "max-age=31536000; includeSubDomains; preload", + "CF-Cache-Status": "DYNAMIC", + "Set-Cookie": [ + "__cf_bm=upcl1KdgiKLJ98rMfYbWz3aOU6JPnrOiUHpuZFT4Gxw-1729560510-1.0.1.1-raAredPc2exiKdm_v.AYk0LKwczq485QcxIhJogC04zjUWaSgb61m6k8u1F5kdNk6DKLQWF_ujqOPRvH7lFflw; path=\/; expires=Tue, 22-Oct-24 01:58:30 GMT; domain=.api.openai.com; HttpOnly; Secure; SameSite=None", + "_cfuvid=cAAkbxSH6_wTW48Cmejcl7smgtP2yjzbhNKLUKT2.Hc-1729560510391-0.0.1.1-604800000; path=\/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None" + ], + "X-Content-Type-Options": "nosniff", + "Server": "cloudflare", + "CF-RAY": "8d65b5f859528cbf-EWR", + "alt-svc": "h3=\":443\"; ma=86400" + }, + "data": "{\n \"id\": \"chatcmpl-AKxzA3EnBjDwKYYEPJwZV1gvKQoPR\",\n \"object\": \"chat.completion\",\n \"created\": 1729560508,\n \"model\": \"gpt-4-turbo-2024-04-09\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": null,\n \"tool_calls\": [\n {\n \"id\": \"call_QPwVBq9tehyE7ecdApXFVy3p\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"query_s_q_l_data_base_tool\",\n \"arguments\": \"{\\\"query\\\":\\\"SELECT COUNT(*) AS total_operating_organizations, AVG(funding_rounds) AS average_funding_rounds FROM organizations WHERE status = 'operating'\\\"}\"\n }\n }\n ],\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"tool_calls\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 484,\n \"completion_tokens\": 49,\n \"total_tokens\": 533,\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/Agents/SQLToolAgent-df626a1c7b4955432c0bc96cdbffe38f.json b/tests/Fixtures/Saloon/Agents/SQLToolAgent-df626a1c7b4955432c0bc96cdbffe38f.json new file mode 100644 index 0000000..5e48159 --- /dev/null +++ b/tests/Fixtures/Saloon/Agents/SQLToolAgent-df626a1c7b4955432c0bc96cdbffe38f.json @@ -0,0 +1,31 @@ +{ + "statusCode": 200, + "headers": { + "Date": "Tue, 22 Oct 2024 01:28:34 GMT", + "Content-Type": "application\/json", + "Content-Length": "1060", + "Connection": "keep-alive", + "access-control-expose-headers": "X-Request-ID", + "openai-organization": "user-5hvzt3x5aqwr0picqhxifwl8", + "openai-processing-ms": "2185", + "openai-version": "2020-10-01", + "x-ratelimit-limit-requests": "10000", + "x-ratelimit-limit-tokens": "2000000", + "x-ratelimit-remaining-requests": "9999", + "x-ratelimit-remaining-tokens": "1998930", + "x-ratelimit-reset-requests": "6ms", + "x-ratelimit-reset-tokens": "32ms", + "x-request-id": "req_aafe2fd5dbe16429550a7527f2cabbcf", + "strict-transport-security": "max-age=31536000; includeSubDomains; preload", + "CF-Cache-Status": "DYNAMIC", + "Set-Cookie": [ + "__cf_bm=JDiVxyYgVNe_yBBxkGfQomTdzG4JoK8E11aLZgycIzE-1729560514-1.0.1.1-1ZSNkZaiLPrky_UFNGJliTFeGRzwIqIULDSsKoYbQ.nHC2OuvB0hVfWSPFh7b6yHthjacqyw1tTb93.QixQUaw; path=\/; expires=Tue, 22-Oct-24 01:58:34 GMT; domain=.api.openai.com; HttpOnly; Secure; SameSite=None", + "_cfuvid=mzHdwKR1_IP7tY1cLCCHyeICk34M4fPv1JQg0OXZ0mE-1729560514175-0.0.1.1-604800000; path=\/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None" + ], + "X-Content-Type-Options": "nosniff", + "Server": "cloudflare", + "CF-RAY": "8d65b60f28834291-EWR", + "alt-svc": "h3=\":443\"; ma=86400" + }, + "data": "{\n \"id\": \"chatcmpl-AKxzEIQXqjmwtLzc9lBOCexAWCeLu\",\n \"object\": \"chat.completion\",\n \"created\": 1729560512,\n \"model\": \"gpt-4-turbo-2024-04-09\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": null,\n \"tool_calls\": [\n {\n \"id\": \"call_873PdtJ71IOO02xUU6KkokEm\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"query_s_q_l_data_base_tool\",\n \"arguments\": \"{\\\"query\\\":\\\"SELECT COUNT(*) AS total_operating_organizations, AVG(num_funding_rounds) AS average_funding_rounds FROM organizations WHERE status = 'operating'\\\"}\"\n }\n }\n ],\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"tool_calls\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 1323,\n \"completion_tokens\": 50,\n \"total_tokens\": 1373,\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/Console/SynapseArtisan-0619d6097b2a0bb5bfb6ef58d9dec10a.json b/tests/Fixtures/Saloon/Console/SynapseArtisan-0619d6097b2a0bb5bfb6ef58d9dec10a.json new file mode 100644 index 0000000..94e125a --- /dev/null +++ b/tests/Fixtures/Saloon/Console/SynapseArtisan-0619d6097b2a0bb5bfb6ef58d9dec10a.json @@ -0,0 +1,31 @@ +{ + "statusCode": 200, + "headers": { + "Date": "Tue, 22 Oct 2024 01:28:40 GMT", + "Content-Type": "application\/json", + "Content-Length": "686", + "Connection": "keep-alive", + "access-control-expose-headers": "X-Request-ID", + "openai-organization": "user-5hvzt3x5aqwr0picqhxifwl8", + "openai-processing-ms": "897", + "openai-version": "2020-10-01", + "x-ratelimit-limit-requests": "10000", + "x-ratelimit-limit-tokens": "2000000", + "x-ratelimit-remaining-requests": "9999", + "x-ratelimit-remaining-tokens": "1999539", + "x-ratelimit-reset-requests": "6ms", + "x-ratelimit-reset-tokens": "13ms", + "x-request-id": "req_10490703b310d85c036e2e1f8dae319e", + "strict-transport-security": "max-age=31536000; includeSubDomains; preload", + "CF-Cache-Status": "DYNAMIC", + "Set-Cookie": [ + "__cf_bm=55P6ASxoIUaoHIJgOdF7qASi3DSyamurOKRInzQtkiY-1729560520-1.0.1.1-0IhzESt4BLKyCFMKWRMgIcv_Az8ntA_vkIbRoaAlNPUqhcuqf9al2QPfp8iQGADFTd332IRcf8_BCdV1MLOgEg; path=\/; expires=Tue, 22-Oct-24 01:58:40 GMT; domain=.api.openai.com; HttpOnly; Secure; SameSite=None", + "_cfuvid=IBDk1BFi3MTRT248ag1g44JWc3wgTyVhyMiGURwgGcg-1729560520410-0.0.1.1-604800000; path=\/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None" + ], + "X-Content-Type-Options": "nosniff", + "Server": "cloudflare", + "CF-RAY": "8d65b63e3b518c51-EWR", + "alt-svc": "h3=\":443\"; ma=86400" + }, + "data": "{\n \"id\": \"chatcmpl-AKxzLLvd8Tfu3jRyidjalgHiBFVza\",\n \"object\": \"chat.completion\",\n \"created\": 1729560519,\n \"model\": \"gpt-4-turbo-2024-04-09\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"```json\\n{\\n \\\"command\\\": \\\"make:model Flight -m\\\"\\n}\\n```\",\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 493,\n \"completion_tokens\": 17,\n \"total_tokens\": 510,\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/Console/SynapseArtisan-d04b51b713a0ff18d2779ed7991fbc0b.json b/tests/Fixtures/Saloon/Console/SynapseArtisan-d04b51b713a0ff18d2779ed7991fbc0b.json new file mode 100644 index 0000000..98431b7 --- /dev/null +++ b/tests/Fixtures/Saloon/Console/SynapseArtisan-d04b51b713a0ff18d2779ed7991fbc0b.json @@ -0,0 +1,31 @@ +{ + "statusCode": 200, + "headers": { + "Date": "Tue, 22 Oct 2024 01:28:42 GMT", + "Content-Type": "application\/json", + "Content-Length": "688", + "Connection": "keep-alive", + "access-control-expose-headers": "X-Request-ID", + "openai-organization": "user-5hvzt3x5aqwr0picqhxifwl8", + "openai-processing-ms": "1006", + "openai-version": "2020-10-01", + "x-ratelimit-limit-requests": "10000", + "x-ratelimit-limit-tokens": "2000000", + "x-ratelimit-remaining-requests": "9999", + "x-ratelimit-remaining-tokens": "1999494", + "x-ratelimit-reset-requests": "6ms", + "x-ratelimit-reset-tokens": "15ms", + "x-request-id": "req_09331ab953779e8e8fa0fb2d0d57675b", + "strict-transport-security": "max-age=31536000; includeSubDomains; preload", + "CF-Cache-Status": "DYNAMIC", + "Set-Cookie": [ + "__cf_bm=5XgyM459nLkc9RlYR63oDfEL7w64CmAic2MqckG9vS4-1729560522-1.0.1.1-XDx0oD4aIYopGa_93NH.b5fjWNz5zliz9_Em41fKzJX2Lpd72yoNaBqPJa6LmdueNUC8lSu0.b76EawU5FQiuw; path=\/; expires=Tue, 22-Oct-24 01:58:42 GMT; domain=.api.openai.com; HttpOnly; Secure; SameSite=None", + "_cfuvid=dWLooX_xtpDA4mDJi5ryLB2F_kga5Dqp9psHIn38qrQ-1729560522586-0.0.1.1-604800000; path=\/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None" + ], + "X-Content-Type-Options": "nosniff", + "Server": "cloudflare", + "CF-RAY": "8d65b64b0e464414-EWR", + "alt-svc": "h3=\":443\"; ma=86400" + }, + "data": "{\n \"id\": \"chatcmpl-AKxzNhcfKVnsynbDO81nnCxxGYzxx\",\n \"object\": \"chat.completion\",\n \"created\": 1729560521,\n \"model\": \"gpt-4-turbo-2024-04-09\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"```json\\n{\\n \\\"command\\\": \\\"make:model Plane -m -c\\\"\\n}\\n```\",\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 547,\n \"completion_tokens\": 19,\n \"total_tokens\": 566,\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/Integrations/ClaudeToolTestAgent-652ecfbf9539e59a6fd65d11f1a2fba2.json b/tests/Fixtures/Saloon/Integrations/ClaudeToolTestAgent-652ecfbf9539e59a6fd65d11f1a2fba2.json new file mode 100644 index 0000000..c5e3d87 --- /dev/null +++ b/tests/Fixtures/Saloon/Integrations/ClaudeToolTestAgent-652ecfbf9539e59a6fd65d11f1a2fba2.json @@ -0,0 +1,10 @@ +{ + "statusCode": 200, + "headers": { + "Date": "Tue, 22 Oct 2024 01:10:34 GMT", + "Content-Type": "application\/json", + "Content-Length": "554", + "Connection": "keep-alive" + }, + "data": "{\"id\":\"msg_01UhGwrG9YgACCgLu48F2tx8\",\"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 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.\\\"\\n}\"}],\"stop_reason\":\"end_turn\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1610,\"output_tokens\":73}}" +} diff --git a/tests/Fixtures/Saloon/Integrations/ClaudeToolTestAgent-9e4ad814794b1055d28d99c79ff01b37.json b/tests/Fixtures/Saloon/Integrations/ClaudeToolTestAgent-9e4ad814794b1055d28d99c79ff01b37.json new file mode 100644 index 0000000..e048e02 --- /dev/null +++ b/tests/Fixtures/Saloon/Integrations/ClaudeToolTestAgent-9e4ad814794b1055d28d99c79ff01b37.json @@ -0,0 +1,10 @@ +{ + "statusCode": 200, + "headers": { + "Date": "Tue, 22 Oct 2024 01:10:30 GMT", + "Content-Type": "application/json", + "Content-Length": "557", + "Connection": "keep-alive" + }, + "data": "{\"id\":\"msg_01Eq8LoF24ttPcPdZCx5FVzq\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"claude-3-5-sonnet-20240620\",\"content\":[{\"type\":\"text\",\"text\":\"To search Google for information about the current president of the United States, I'll use the serper_tool function. Here's how I'll structure the query:\"},{\"type\":\"tool_use\",\"id\":\"toolu_01AZWBaBr57C7x92FbW8GxuX\",\"name\":\"serper_tool\",\"input\":{\"query\":\"current president of the United States\",\"searchType\":\"search\"}}],\"stop_reason\":\"tool_use\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":554,\"output_tokens\":111}}" +} diff --git a/tests/Fixtures/Saloon/Integrations/ClaudeToolTestAgent-e6ed7a42ff9b7106aa22db121275e575.json b/tests/Fixtures/Saloon/Integrations/ClaudeToolTestAgent-e6ed7a42ff9b7106aa22db121275e575.json new file mode 100644 index 0000000..6131849 --- /dev/null +++ b/tests/Fixtures/Saloon/Integrations/ClaudeToolTestAgent-e6ed7a42ff9b7106aa22db121275e575.json @@ -0,0 +1,10 @@ +{ + "statusCode": 200, + "headers": { + "Date": "Tue, 22 Oct 2024 01:10:32 GMT", + "Content-Type": "application\/json", + "Content-Length": "690", + "Connection": "keep-alive" + }, + "data": "{\"id\":\"msg_01BmxjB7URqBjdHs994ijozw\",\"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 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.\\\"\\n}\\n```\"}],\"stop_reason\":\"end_turn\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":1413,\"output_tokens\":102}}" +} diff --git a/tests/Fixtures/Saloon/Integrations/OllamaTestAgent-Serper-Tool.json b/tests/Fixtures/Saloon/Integrations/OllamaTestAgent-Serper-Tool.json new file mode 100644 index 0000000..3d1b7bf --- /dev/null +++ b/tests/Fixtures/Saloon/Integrations/OllamaTestAgent-Serper-Tool.json @@ -0,0 +1,18 @@ +{ + "statusCode": 200, + "headers": { + "access-control-allow-origin": "*", + "x-ratelimit-limit": "500", + "x-ratelimit-remaining": "499", + "x-ratelimit-reset": "1729559610", + "content-type": "application\/json; charset=utf-8", + "x-cloud-trace-context": "3306ea4ecb0fdb4d634a34089f9366bc", + "set-cookie": "GAESA=CowBMDA3OTg5ZjJhMTUxNDY0YzcyYTk1Mjg4MzA4N2QwNGUwNjgwZjVhNWI3OWI3YmEyNmU2NjAyZGQzMDMxZDI5Yzg0NzNmOWUyZDY0YzJjMzQ0MTI2ODNjOGNiN2QyZmJlNTllZGEzZTRjYjU5MGI2NGFmYzg2NmQxMGMwODFiYmM2MzhhYjE1YmJiMDUQhISljqsy; expires=Thu, 21-Nov-2024 01:13:29 GMT; path=\/", + "date": "Tue, 22 Oct 2024 01:13:29 GMT", + "server": "Google Frontend", + "Content-Length": "5698", + "via": "1.1 google", + "Alt-Svc": "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + }, + "data": "{\"searchParameters\":{\"q\":\"current president of the united states\",\"type\":\"search\",\"num\":10,\"engine\":\"google\"},\"organic\":[{\"title\":\"Joe Biden: The President | The White House\",\"link\":\"https:\/\/www.whitehouse.gov\/administration\/president-biden\/\",\"snippet\":\"President Biden represented Delaware for 36 years in the US Senate before becoming the 47th Vice President of the United States.\",\"position\":1},{\"title\":\"President of the United States - Wikipedia\",\"link\":\"https:\/\/en.wikipedia.org\/wiki\/President_of_the_United_States\",\"snippet\":\"The president of the United States (POTUS) is the head of state and head of government of the United States of America. The president directs the executive ...\",\"sitelinks\":[{\"title\":\"American Presidents\",\"link\":\"https:\/\/en.wikipedia.org\/wiki\/List_of_presidents_of_the_United_States\"},{\"title\":\"Powers of the president\",\"link\":\"https:\/\/en.wikipedia.org\/wiki\/Powers_of_the_president_of_the_United_States\"},{\"title\":\"Executive Office of the\",\"link\":\"https:\/\/en.wikipedia.org\/wiki\/Executive_Office_of_the_President_of_the_United_States\"},{\"title\":\"Talk\",\"link\":\"https:\/\/en.wikipedia.org\/wiki\/President_of_the_United_States_(disambiguation)\"}],\"position\":2},{\"title\":\"President of the United States\",\"link\":\"https:\/\/usun.usmission.gov\/our-leaders\/the-president-of-the-united-states\/\",\"snippet\":\"President Biden represented Delaware for 36 years in the US Senate before becoming the 47th Vice President of the United States.\",\"position\":3},{\"title\":\"President Joe Biden (@potus) \u2022 Instagram photos and videos\",\"link\":\"https:\/\/www.instagram.com\/potus\/?hl=en\",\"snippet\":\"19M Followers, 5 Following, 4480 Posts - President Joe Biden (@potus) on Instagram: \\\"46th President of the United States, husband to @flotus, proud dad and ...\",\"position\":4},{\"title\":\"Presidents, vice presidents, and first ladies | USAGov\",\"link\":\"https:\/\/www.usa.gov\/presidents\",\"snippet\":\"Learn about the duties of the U.S. president, vice president, and first lady. Find out how to contact and learn more about current and past ...\",\"date\":\"Sep 20, 2024\",\"position\":5},{\"title\":\"The Executive Branch | The White House\",\"link\":\"https:\/\/www.whitehouse.gov\/about-the-white-house\/our-government\/the-executive-branch\/\",\"snippet\":\"From the President, to the Vice President, to the Cabinet, learn more about the Executive Branch of the government of the United States.\",\"position\":6},{\"title\":\"Joe Biden - Wikipedia\",\"link\":\"https:\/\/en.wikipedia.org\/wiki\/Joe_Biden\",\"snippet\":\"Joseph Robinette Biden Jr. (born November 20, 1942) is an American politician who has been the 46th and current president of the United States since 2021.\",\"position\":7},{\"title\":\"President Joe Biden - Facebook\",\"link\":\"https:\/\/www.facebook.com\/POTUS\/\",\"snippet\":\"President Joe Biden. 10328420 likes \u00b7 100413 talking about this. 46th President of the United States, husband to @FLOTUS, proud father and pop. Text...\",\"sitelinks\":[{\"title\":\"Photos\",\"link\":\"https:\/\/m.facebook.com\/POTUS\/photos\/\"},{\"title\":\"Followers\",\"link\":\"https:\/\/m.facebook.com\/POTUS\/followers\/\"},{\"title\":\"Iniciar sesi\u00f3n\",\"link\":\"https:\/\/www.facebook.com\/POTUS\/?locale=es_LA\"},{\"title\":\"\u8a73\u7d30\u8cc7\u6599\",\"link\":\"https:\/\/m.facebook.com\/POTUS\/?locale=zh_TW\"}],\"position\":8},{\"title\":\"Joe Biden's Path to the United States Presidency | Britannica\",\"link\":\"https:\/\/www.britannica.com\/video\/who-is-President-Joe-Biden\/-261012\",\"snippet\":\"Learn more about the life and career of Joe Biden, the 46th president of the United States.\",\"date\":\"Jan 7, 2022\",\"attributes\":{\"Duration\":\"2:21\",\"Posted\":\"Jan 7, 2022\"},\"position\":9},{\"title\":\"President Joe Biden | CNN Politics\",\"link\":\"https:\/\/www.cnn.com\/politics\/joe-biden\",\"snippet\":\"CNN coverage of Joseph R. Biden, the 46th president of the United States \u00b7 Latest Headlines \u00b7 Latest Video \u00b7 Spotlight \u00b7 Vice President Kamala Harris \u00b7 More News.\",\"position\":10}],\"peopleAlsoAsk\":[{\"question\":\"Who is the new president of the United States?\",\"snippet\":\"President Biden graduated from the University of Delaware and Syracuse Law School and served on the New Castle County Council. At age 29, President Biden became one of the youngest Americans ever elected to the United States Senate.\",\"title\":\"Joe Biden: The President | The White House\",\"link\":\"https:\/\/www.whitehouse.gov\/administration\/president-biden\/\"},{\"question\":\"Who was the youngest president of the USA?\",\"snippet\":\"The median age at inauguration of incoming U.S. presidents is 55 years. The youngest person to become U.S. president was Theodore Roosevelt, who, at age 42, succeeded to the office after the assassination of William McKinley.\",\"title\":\"List of presidents of the United States by age - Wikipedia\",\"link\":\"https:\/\/en.wikipedia.org\/wiki\/List_of_presidents_of_the_United_States_by_age\"},{\"question\":\"Who is the 50th president?\",\"snippet\":\"Joseph R. Biden Jr.\",\"title\":\"Presidents | The White House\",\"link\":\"https:\/\/www.whitehouse.gov\/about-the-white-house\/presidents\/\"},{\"question\":\"Who is number 1 president?\",\"snippet\":\"On April 30, 1789, George Washington, standing on the balcony of Federal Hall on Wall Street in New York, took his oath of office as the first President of the United States.\",\"title\":\"George Washington | The White House\",\"link\":\"https:\/\/www.whitehouse.gov\/about-the-white-house\/presidents\/george-washington\/\"}],\"relatedSearches\":[{\"query\":\"Who is the current Vice President of the United States\"},{\"query\":\"Who is the 46th president\"},{\"query\":\"Who is the New President of the United States\"},{\"query\":\"Who is the 47th President of the United States\"},{\"query\":\"All Presidents in order\"},{\"query\":\"Joe Biden age\"},{\"query\":\"48th President of the United States\"},{\"query\":\"Is Joe Biden still president\"}],\"credits\":1}" +} \ No newline at end of file diff --git a/tests/Fixtures/Saloon/Integrations/OllamaTestAgent-d8f986e1f1fc626f7d0d10b0fd2ba58f.json b/tests/Fixtures/Saloon/Integrations/OllamaTestAgent-d8f986e1f1fc626f7d0d10b0fd2ba58f.json new file mode 100644 index 0000000..b5935b5 --- /dev/null +++ b/tests/Fixtures/Saloon/Integrations/OllamaTestAgent-d8f986e1f1fc626f7d0d10b0fd2ba58f.json @@ -0,0 +1,9 @@ +{ + "statusCode": 200, + "headers": { + "Content-Type": "application\/json; charset=utf-8", + "Date": "Tue, 22 Oct 2024 01:12:45 GMT", + "Content-Length": "330" + }, + "data": "{\"model\":\"llama3.2\",\"created_at\":\"2024-10-22T01:12:45.859244298Z\",\"message\":{\"role\":\"assistant\",\"content\":\"{\\n \\\"answer\\\": \\\"Hello!\\\" }\\n```\"},\"done_reason\":\"stop\",\"done\":true,\"total_duration\":2645440997,\"load_duration\":20609427,\"prompt_eval_count\":111,\"prompt_eval_duration\":1796052000,\"eval_count\":11,\"eval_duration\":704477000}" +} \ No newline at end of file diff --git a/tests/Fixtures/Saloon/Integrations/OllamaToolTestAgent-73a9b9db662176ac0a3ed17dec715886.json b/tests/Fixtures/Saloon/Integrations/OllamaToolTestAgent-73a9b9db662176ac0a3ed17dec715886.json new file mode 100644 index 0000000..6aa8e64 --- /dev/null +++ b/tests/Fixtures/Saloon/Integrations/OllamaToolTestAgent-73a9b9db662176ac0a3ed17dec715886.json @@ -0,0 +1,9 @@ +{ + "statusCode": 200, + "headers": { + "Content-Type": "application\/json; charset=utf-8", + "Date": "Tue, 22 Oct 2024 01:13:52 GMT", + "Content-Length": "391" + }, + "data": "{\"model\":\"llama3.2\",\"created_at\":\"2024-10-22T01:13:52.227941545Z\",\"message\":{\"role\":\"assistant\",\"content\":\"```\\n{\\n \\\"answer\\\": \\\"The current President of the United States is Joe Biden.\\\"\\n}\\n```\"},\"done_reason\":\"stop\",\"done\":true,\"total_duration\":22040210143,\"load_duration\":20179864,\"prompt_eval_count\":855,\"prompt_eval_duration\":20239842000,\"eval_count\":22,\"eval_duration\":1568235000}" +} \ No newline at end of file diff --git a/tests/Fixtures/Saloon/Integrations/OllamaToolTestAgent-c0527b86cfc080fa4aaa3255dd06edfc.json b/tests/Fixtures/Saloon/Integrations/OllamaToolTestAgent-c0527b86cfc080fa4aaa3255dd06edfc.json new file mode 100644 index 0000000..7514713 --- /dev/null +++ b/tests/Fixtures/Saloon/Integrations/OllamaToolTestAgent-c0527b86cfc080fa4aaa3255dd06edfc.json @@ -0,0 +1,9 @@ +{ + "statusCode": 200, + "headers": { + "Content-Type": "application/json; charset=utf-8", + "Date": "Tue, 22 Oct 2024 01:13:28 GMT", + "Content-Length": "456" + }, + "data": "{\"model\":\"llama3.2\",\"created_at\":\"2024-10-22T01:13:28.947376961Z\",\"message\":{\"role\":\"assistant\",\"content\":\"\",\"tool_calls\":[{\"function\":{\"name\":\"serper_tool\",\"arguments\":{\"numberOfResults\":\"10\",\"query\":\"current president of the united states\",\"searchType\":\"search\"}}}]},\"done_reason\":\"stop\",\"done\":true,\"total_duration\":9544760508,\"load_duration\":19568592,\"prompt_eval_count\":325,\"prompt_eval_duration\":7393902000,\"eval_count\":29,\"eval_duration\":2007733000}" +} diff --git a/tests/Fixtures/Saloon/Integrations/OpenAiTestAgent.json b/tests/Fixtures/Saloon/Integrations/OpenAiTestAgent.json index 1c54aa1..29bdd4e 100644 --- a/tests/Fixtures/Saloon/Integrations/OpenAiTestAgent.json +++ b/tests/Fixtures/Saloon/Integrations/OpenAiTestAgent.json @@ -1,11 +1,10 @@ { "statusCode": 200, "headers": { - "Date": "Tue, 03 Sep 2024 13:42:17 GMT", + "Date": "Tue, 22 Oct 2024 01:14:46 GMT", "Content-Type": "application/json", - "Transfer-Encoding": "chunked", - "Connection": "keep-alive", - "access-control-expose-headers": "X-Request-ID" + "Content-Length": "655", + "Connection": "keep-alive" }, - "data": "{\n \"id\": \"chatcmpl-A3O5Qpfpxf81z5tX22ERNZb35glfD\",\n \"object\": \"chat.completion\",\n \"created\": 1725370936,\n \"model\": \"gpt-4-turbo-2024-04-09\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"{\\n \\\"answer\\\": \\\"Hello! How can I assist you today?\\\"\\n}\",\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 53,\n \"completion_tokens\": 16,\n \"total_tokens\": 69\n },\n \"system_fingerprint\": \"fp_6f7679d977\"\n}\n" + "data": "{\n \"id\": \"chatcmpl-AKxltPt5yDOlBBJmGR7TAth1NH7bS\",\n \"object\": \"chat.completion\",\n \"created\": 1729559685,\n \"model\": \"gpt-4-turbo-2024-04-09\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"{\\n \\\"answer\\\": \\\"Hello!\\\"\\n}\",\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 96,\n \"completion_tokens\": 9,\n \"total_tokens\": 105,\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/Integrations/OpenAiToolTestAgent-147b4da15ee217a94e1c4f7dc5629343.json b/tests/Fixtures/Saloon/Integrations/OpenAiToolTestAgent-147b4da15ee217a94e1c4f7dc5629343.json deleted file mode 100644 index ae2f00b..0000000 --- a/tests/Fixtures/Saloon/Integrations/OpenAiToolTestAgent-147b4da15ee217a94e1c4f7dc5629343.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "statusCode": 200, - "headers": { - "Date": "Thu, 03 Oct 2024 17:23:12 GMT", - "Content-Type": "application/json", - "Transfer-Encoding": "chunked", - "Connection": "keep-alive", - "access-control-expose-headers": "X-Request-ID" - }, - "data": "{\n \"id\": \"chatcmpl-AEJpeM2PfEIKV9BZuxB4Ah4dJ7K0X\",\n \"object\": \"chat.completion\",\n \"created\": 1727976190,\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 is the current president of the United States.\\\"\\n}\\n```\",\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 880,\n \"completion_tokens\": 23,\n \"total_tokens\": 903,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0\n }\n },\n \"system_fingerprint\": \"fp_81dd8129df\"\n}\n" -} diff --git a/tests/Fixtures/Saloon/Integrations/OpenAiToolTestAgent-4d9c37b83db9353afd0462b60417eb0e.json b/tests/Fixtures/Saloon/Integrations/OpenAiToolTestAgent-8c4de06e2a7064e26c30dd1131e7c149.json similarity index 56% rename from tests/Fixtures/Saloon/Integrations/OpenAiToolTestAgent-4d9c37b83db9353afd0462b60417eb0e.json rename to tests/Fixtures/Saloon/Integrations/OpenAiToolTestAgent-8c4de06e2a7064e26c30dd1131e7c149.json index d0ce0dd..44ec98b 100644 --- a/tests/Fixtures/Saloon/Integrations/OpenAiToolTestAgent-4d9c37b83db9353afd0462b60417eb0e.json +++ b/tests/Fixtures/Saloon/Integrations/OpenAiToolTestAgent-8c4de06e2a7064e26c30dd1131e7c149.json @@ -1,10 +1,10 @@ { "statusCode": 200, "headers": { - "Date": "Thu, 03 Oct 2024 17:23:10 GMT", + "Date": "Tue, 22 Oct 2024 01:14:47 GMT", "Content-Type": "application\/json", - "Transfer-Encoding": "chunked", + "Content-Length": "985", "Connection": "keep-alive" }, - "data": "{\n \"id\": \"chatcmpl-AEJpccJWz9qvkwuy6jEQhEpD40Ngd\",\n \"object\": \"chat.completion\",\n \"created\": 1727976188,\n \"model\": \"gpt-4-turbo-2024-04-09\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": null,\n \"tool_calls\": [\n {\n \"id\": \"call_7tXuQWM2W5rwp0ERvWtfwPjX\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"serper_tool\",\n \"arguments\": \"{\\\"query\\\":\\\"current president of the United States\\\",\\\"searchType\\\":\\\"search\\\",\\\"numberOfResults\\\":10}\"\n }\n }\n ],\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"tool_calls\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 178,\n \"completion_tokens\": 30,\n \"total_tokens\": 208,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0\n }\n },\n \"system_fingerprint\": \"fp_81dd8129df\"\n}\n" + "data": "{\n \"id\": \"chatcmpl-AKxluvQCEThkm2qOIuQGOzO4ije0d\",\n \"object\": \"chat.completion\",\n \"created\": 1729559686,\n \"model\": \"gpt-4-turbo-2024-04-09\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": null,\n \"tool_calls\": [\n {\n \"id\": \"call_mL9H73EAkD9uUEPZLbDITNRK\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"serper_tool\",\n \"arguments\": \"{\\\"query\\\":\\\"current president of the United States\\\",\\\"searchType\\\":\\\"search\\\",\\\"numberOfResults\\\":10}\"\n }\n }\n ],\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"tool_calls\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 213,\n \"completion_tokens\": 30,\n \"total_tokens\": 243,\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/Integrations/OpenAiToolTestAgent-Serper-Tool.json b/tests/Fixtures/Saloon/Integrations/OpenAiToolTestAgent-Serper-Tool.json index 7576b1b..87afe41 100644 --- a/tests/Fixtures/Saloon/Integrations/OpenAiToolTestAgent-Serper-Tool.json +++ b/tests/Fixtures/Saloon/Integrations/OpenAiToolTestAgent-Serper-Tool.json @@ -1,11 +1,10 @@ { - "statusCode": 200, - "headers": { - "access-control-allow-origin": "*", - "x-ratelimit-limit": "500", - "x-ratelimit-remaining": "499", - "x-ratelimit-reset": "1725375100", - "content-type": "application/json; charset=utf-8" - }, - "data": "{\"searchParameters\":{\"q\":\"current President of the United States\",\"type\":\"search\",\"num\":10,\"engine\":\"google\"},\"answerBox\":{\"title\":\"United States / President\",\"answer\":\"Joe Biden\"},\"organic\":[{\"title\":\"President of the United States - Wikipedia\",\"link\":\"https://en.wikipedia.org/wiki/President_of_the_United_States\",\"snippet\":\"The president of the United States (POTUS) is the head of state and head of government of the United States of America. The president directs the executive ...\",\"position\":1},{\"title\":\"Joe Biden: The President | The White House\",\"link\":\"https://www.whitehouse.gov/administration/president-biden/\",\"snippet\":\"President Biden represented Delaware for 36 years in the US Senate before becoming the 47th Vice President of the United States.\",\"position\":2},{\"title\":\"Presidents, vice presidents, and first ladies | USAGov\",\"link\":\"https://www.usa.gov/presidents\",\"snippet\":\"Learn about the duties of the U.S. president, vice president, and first lady. Find out how to contact and learn more about current and past ...\",\"date\":\"Dec 6, 2023\",\"position\":3},{\"title\":\"President of the United States\",\"link\":\"https://usun.usmission.gov/our-leaders/the-president-of-the-united-states/\",\"snippet\":\"President Biden represented Delaware for 36 years in the US Senate before becoming the 47th Vice President of the United States.\",\"position\":4},{\"title\":\"The Executive Branch | The White House\",\"link\":\"https://www.whitehouse.gov/about-the-white-house/our-government/the-executive-branch/\",\"snippet\":\"From the President, to the Vice President, to the Cabinet, learn more about the Executive Branch of the government of the United States.\",\"position\":5},{\"title\":\"President Joe Biden (@potus) \u2022 Instagram profile\",\"link\":\"https://www.instagram.com/potus/?hl=en\",\"snippet\":\"19M Followers, 5 Following, 4282 Posts - President Joe Biden (@potus) on Instagram: \\\"46th President of the United States, husband to @flotus, proud dad and ...\",\"position\":6},{\"title\":\"President Joe Biden - Facebook\",\"link\":\"https://www.facebook.com/POTUS/\",\"snippet\":\"President Joe Biden. 10344211 likes \u00b7 287600 talking about this. 46th President of the United States, husband to @FLOTUS, proud father and pop. Text...\",\"position\":7},{\"title\":\"Joe Biden - Wikipedia\",\"link\":\"https://en.wikipedia.org/wiki/Joe_Biden\",\"snippet\":\"Joseph Robinette Biden Jr. (born November 20, 1942) is an American politician serving as the 46th and current president of the United States since 2021.\",\"sitelinks\":[{\"title\":\"Political positions\",\"link\":\"https://en.wikipedia.org/wiki/Political_positions_of_Joe_Biden\"},{\"title\":\"Electoral history\",\"link\":\"https://en.wikipedia.org/wiki/Electoral_history_of_Joe_Biden\"},{\"title\":\"United States House Oversight\",\"link\":\"https://en.wikipedia.org/wiki/United_States_House_Oversight_Committee_investigation_into_the_Biden_family\"},{\"title\":\"Jill Biden\",\"link\":\"https://en.wikipedia.org/wiki/Jill_Biden\"}],\"position\":8},{\"title\":\"Joe Biden's Path to the United States Presidency | Britannica\",\"link\":\"https://www.britannica.com/video/226766/who-is-President-Joe-Biden\",\"snippet\":\"Learn more about the life and career of Joe Biden, the 46th president of the United States.\",\"date\":\"Jan 7, 2022\",\"attributes\":{\"Duration\":\"2:21\",\"Posted\":\"Jan 7, 2022\"},\"imageUrl\":\"https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcTy2z3ONNaR5BsVyaVUp_PIfgjZYBB-erXUwbbLCz-1jox2T8j1i9A6FA0\",\"position\":9},{\"title\":\"Joe Biden | Biography, Family, Policies, & Facts - Britannica\",\"link\":\"https://www.britannica.com/biography/Joe-Biden\",\"snippet\":\"Joe Biden, the 46th president of the United States, brings decades of political experience and a commitment to unity as he leads America through challenging ...\",\"position\":10}],\"peopleAlsoAsk\":[{\"question\":\"Who is the number 1 US president?\",\"snippet\":\"Abraham Lincoln has taken the highest ranking in each survey and George Washington, Franklin D. Roosevelt, and Theodore Roosevelt have always ranked in the top five while James Buchanan, Andrew Johnson, and Franklin Pierce have been ranked at the bottom of all four surveys.\",\"title\":\"Historical rankings of presidents of the United States - Wikipedia\",\"link\":\"https://en.wikipedia.org/wiki/Historical_rankings_of_presidents_of_the_United_States\"},{\"question\":\"Who is next in line for President of us?\",\"snippet\":\"No.\\nOffice\\nParty\\n1\\nVice President\\nDemocratic\\n2\\nSpeaker of the House of Representatives\\nRepublican\\n3\\nPresident pro tempore of the Senate\\nDemocratic\\n4\\nSecretary of State\\nDemocratic\",\"title\":\"United States presidential line of succession - Wikipedia\",\"link\":\"https://en.wikipedia.org/wiki/United_States_presidential_line_of_succession\"},{\"question\":\"Who is the Vice President of the United States today?\",\"snippet\":\"Kamala D. Harris is the Vice President of the United States of America.\",\"title\":\"Vice President of the United States\",\"link\":\"https://ec.usembassy.gov/our-relationship/vice-president/\"},{\"question\":\"Who was the youngest President of the US?\",\"snippet\":\"The median age at inauguration of incoming U.S. presidents is 55 years. The youngest person to become U.S. president was Theodore Roosevelt, who, at age 42, succeeded to the office after the assassination of William McKinley.\",\"title\":\"List of presidents of the United States by age - Wikipedia\",\"link\":\"https://en.wikipedia.org/wiki/List_of_presidents_of_the_United_States_by_age\"}],\"relatedSearches\":[{\"query\":\"Who is the Vice President of the United States\"},{\"query\":\"Who is the 46th president\"},{\"query\":\"All Presidents in order\"},{\"query\":\"48th president of the United States\"},{\"query\":\"Who is the New President of the United States\"},{\"query\":\"First president of USA\"},{\"query\":\"Joe Biden age\"},{\"query\":\"Who is the Prime Minister of USA\"}],\"credits\":1}" + "statusCode": 200, + "headers": { + "access-control-allow-origin": "*", + "x-ratelimit-limit": "500", + "x-ratelimit-remaining": "499", + "x-ratelimit-reset": "1729559690" + }, + "data": "{\"searchParameters\":{\"q\":\"current president of the United States\",\"type\":\"search\",\"num\":10,\"engine\":\"google\"},\"answerBox\":{\"title\":\"United States \/ President\",\"answer\":\"Joe Biden\"},\"organic\":[{\"title\":\"Joe Biden: The President | The White House\",\"link\":\"https:\/\/www.whitehouse.gov\/administration\/president-biden\/\",\"snippet\":\"President Biden represented Delaware for 36 years in the US Senate before becoming the 47th Vice President of the United States.\",\"position\":1},{\"title\":\"President of the United States - Wikipedia\",\"link\":\"https:\/\/en.wikipedia.org\/wiki\/President_of_the_United_States\",\"snippet\":\"The president of the United States (POTUS) is the head of state and head of government of the United States of America. The president directs the executive ...\",\"sitelinks\":[{\"title\":\"American Presidents\",\"link\":\"https:\/\/en.wikipedia.org\/wiki\/List_of_presidents_of_the_United_States\"},{\"title\":\"Powers of the president\",\"link\":\"https:\/\/en.wikipedia.org\/wiki\/Powers_of_the_president_of_the_United_States\"},{\"title\":\"Executive Office of the\",\"link\":\"https:\/\/en.wikipedia.org\/wiki\/Executive_Office_of_the_President_of_the_United_States\"},{\"title\":\"Talk\",\"link\":\"https:\/\/en.wikipedia.org\/wiki\/President_of_the_United_States_(disambiguation)\"}],\"position\":2},{\"title\":\"President of the United States\",\"link\":\"https:\/\/usun.usmission.gov\/our-leaders\/the-president-of-the-united-states\/\",\"snippet\":\"President Biden represented Delaware for 36 years in the US Senate before becoming the 47th Vice President of the United States.\",\"position\":3},{\"title\":\"President Joe Biden (@potus) \u2022 Instagram photos and videos\",\"link\":\"https:\/\/www.instagram.com\/potus\/?hl=en\",\"snippet\":\"19M Followers, 5 Following, 4480 Posts - President Joe Biden (@potus) on Instagram: \\\"46th President of the United States, husband to @flotus, proud dad and ...\",\"position\":4},{\"title\":\"Presidents, vice presidents, and first ladies | USAGov\",\"link\":\"https:\/\/www.usa.gov\/presidents\",\"snippet\":\"Learn about the duties of the U.S. president, vice president, and first lady. Find out how to contact and learn more about current and past ...\",\"date\":\"Sep 20, 2024\",\"position\":5},{\"title\":\"The Executive Branch | The White House\",\"link\":\"https:\/\/www.whitehouse.gov\/about-the-white-house\/our-government\/the-executive-branch\/\",\"snippet\":\"From the President, to the Vice President, to the Cabinet, learn more about the Executive Branch of the government of the United States.\",\"position\":6},{\"title\":\"Joe Biden - Wikipedia\",\"link\":\"https:\/\/en.wikipedia.org\/wiki\/Joe_Biden\",\"snippet\":\"Joseph Robinette Biden Jr. (born November 20, 1942) is an American politician who has been the 46th and current president of the United States since 2021.\",\"position\":7},{\"title\":\"President Joe Biden - Facebook\",\"link\":\"https:\/\/www.facebook.com\/POTUS\/\",\"snippet\":\"President Joe Biden. 10328420 likes \u00b7 100413 talking about this. 46th President of the United States, husband to @FLOTUS, proud father and pop. Text...\",\"sitelinks\":[{\"title\":\"Photos\",\"link\":\"https:\/\/m.facebook.com\/POTUS\/photos\/\"},{\"title\":\"Followers\",\"link\":\"https:\/\/m.facebook.com\/POTUS\/followers\/\"},{\"title\":\"Iniciar sesi\u00f3n\",\"link\":\"https:\/\/www.facebook.com\/POTUS\/?locale=es_LA\"},{\"title\":\"\u8a73\u7d30\u8cc7\u6599\",\"link\":\"https:\/\/m.facebook.com\/POTUS\/?locale=zh_TW\"}],\"position\":8},{\"title\":\"Joe Biden's Path to the United States Presidency | Britannica\",\"link\":\"https:\/\/www.britannica.com\/video\/who-is-President-Joe-Biden\/-261012\",\"snippet\":\"Learn more about the life and career of Joe Biden, the 46th president of the United States.\",\"date\":\"Jan 7, 2022\",\"attributes\":{\"Duration\":\"2:21\",\"Posted\":\"Jan 7, 2022\"},\"position\":9},{\"title\":\"President Joe Biden | CNN Politics\",\"link\":\"https:\/\/www.cnn.com\/politics\/joe-biden\",\"snippet\":\"CNN coverage of Joseph R. Biden, the 46th president of the United States \u00b7 Latest Headlines \u00b7 Latest Video \u00b7 Spotlight \u00b7 Vice President Kamala Harris \u00b7 More News.\",\"position\":10}],\"peopleAlsoAsk\":[{\"question\":\"Who is the new president of the United States?\",\"snippet\":\"President Biden graduated from the University of Delaware and Syracuse Law School and served on the New Castle County Council. At age 29, President Biden became one of the youngest Americans ever elected to the United States Senate.\",\"title\":\"Joe Biden: The President | The White House\",\"link\":\"https:\/\/www.whitehouse.gov\/administration\/president-biden\/\"},{\"question\":\"Who was the youngest president of the USA?\",\"snippet\":\"The median age at inauguration of incoming U.S. presidents is 55 years. The youngest person to become U.S. president was Theodore Roosevelt, who, at age 42, succeeded to the office after the assassination of William McKinley.\",\"title\":\"List of presidents of the United States by age - Wikipedia\",\"link\":\"https:\/\/en.wikipedia.org\/wiki\/List_of_presidents_of_the_United_States_by_age\"},{\"question\":\"Who is the 50th president?\",\"snippet\":\"Joseph R. Biden Jr.\",\"title\":\"Presidents | The White House\",\"link\":\"https:\/\/www.whitehouse.gov\/about-the-white-house\/presidents\/\"},{\"question\":\"Who is number 1 president?\",\"snippet\":\"On April 30, 1789, George Washington, standing on the balcony of Federal Hall on Wall Street in New York, took his oath of office as the first President of the United States.\",\"title\":\"George Washington | The White House\",\"link\":\"https:\/\/www.whitehouse.gov\/about-the-white-house\/presidents\/george-washington\/\"}],\"relatedSearches\":[{\"query\":\"Who is the Vice President of the United States\"},{\"query\":\"Who is the 46th president\"},{\"query\":\"47th President of the United States\"},{\"query\":\"48th President of the United States\"},{\"query\":\"All Presidents in order\"},{\"query\":\"Who is the New President of the United States\"},{\"query\":\"Joe Biden age\"},{\"query\":\"Is Kamala Harris President\"}],\"credits\":1}" } diff --git a/tests/Fixtures/Saloon/Integrations/OpenAiToolTestAgent-e0903793a2fa24d5a334f52b3d9b46c6.json b/tests/Fixtures/Saloon/Integrations/OpenAiToolTestAgent-e0903793a2fa24d5a334f52b3d9b46c6.json new file mode 100644 index 0000000..bb86efc --- /dev/null +++ b/tests/Fixtures/Saloon/Integrations/OpenAiToolTestAgent-e0903793a2fa24d5a334f52b3d9b46c6.json @@ -0,0 +1,10 @@ +{ + "statusCode": 200, + "headers": { + "Date": "Tue, 22 Oct 2024 01:14:50 GMT", + "Content-Type": "application\/json", + "Content-Length": "721", + "Connection": "keep-alive" + }, + "data": "{\n \"id\": \"chatcmpl-AKxlxlegF2fwElaov1NEa1vOeMdEQ\",\n \"object\": \"chat.completion\",\n \"created\": 1729559689,\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 is the current President of the United States.\\\"\\n}\\n```\",\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 913,\n \"completion_tokens\": 23,\n \"total_tokens\": 936,\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/OpenAiWithOutResolveTestAgent.json b/tests/Fixtures/Saloon/Integrations/OpenAiWithOutResolveTestAgent.json index f3b6684..e4b03b7 100644 --- a/tests/Fixtures/Saloon/Integrations/OpenAiWithOutResolveTestAgent.json +++ b/tests/Fixtures/Saloon/Integrations/OpenAiWithOutResolveTestAgent.json @@ -1,9 +1,12 @@ { - "statusCode": 200, - "headers": { - "Date": "Tue, 15 Oct 2024 21:24:38 GMT", - "Content-Type": "application\/json", - "Content-Length": "683" - }, - "data": "{\n \"id\": \"chatcmpl-AIjJtjq1c4bdc6m5NvsF6adhyQ6MA\",\n \"object\": \"chat.completion\",\n \"created\": 1729027477,\n \"model\": \"gpt-4-turbo-2024-04-09\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"{\\n \\\"answer\\\": \\\"Hello! How can I assist you today?\\\"\\n}\",\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 61,\n \"completion_tokens\": 16,\n \"total_tokens\": 77,\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" + "statusCode": 200, + "headers": { + "Date": "Tue, 22 Oct 2024 01:14:45 GMT", + "Content-Type": "application/json", + "Content-Length": "684", + "Connection": "keep-alive", + "access-control-expose-headers": "X-Request-ID", + "openai-organization": "user-5hvzt3x5aqwr0picqhxifwl8" + }, + "data": "{\n \"id\": \"chatcmpl-AKxlsdzTgy5RBFI4xFRDzYCEcntKy\",\n \"object\": \"chat.completion\",\n \"created\": 1729559684,\n \"model\": \"gpt-4-turbo-2024-04-09\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"{\\n \\\"answer\\\": \\\"Hello! How can I assist you today?\\\"\\n}\",\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 96,\n \"completion_tokens\": 16,\n \"total_tokens\": 112,\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/Memory/CollectionMemory-8cefaea3e899f6f2489b3487aa0a040d.json b/tests/Fixtures/Saloon/Memory/CollectionMemory-8cefaea3e899f6f2489b3487aa0a040d.json new file mode 100644 index 0000000..ae9194f --- /dev/null +++ b/tests/Fixtures/Saloon/Memory/CollectionMemory-8cefaea3e899f6f2489b3487aa0a040d.json @@ -0,0 +1,31 @@ +{ + "statusCode": 200, + "headers": { + "Date": "Tue, 22 Oct 2024 01:28:47 GMT", + "Content-Type": "application\/json", + "Content-Length": "696", + "Connection": "keep-alive", + "access-control-expose-headers": "X-Request-ID", + "openai-organization": "user-5hvzt3x5aqwr0picqhxifwl8", + "openai-processing-ms": "1121", + "openai-version": "2020-10-01", + "x-ratelimit-limit-requests": "10000", + "x-ratelimit-limit-tokens": "2000000", + "x-ratelimit-remaining-requests": "9999", + "x-ratelimit-remaining-tokens": "1999839", + "x-ratelimit-reset-requests": "6ms", + "x-ratelimit-reset-tokens": "4ms", + "x-request-id": "req_2b5930e81733c8b7f1ddee551e567a47", + "strict-transport-security": "max-age=31536000; includeSubDomains; preload", + "CF-Cache-Status": "DYNAMIC", + "Set-Cookie": [ + "__cf_bm=rtVTw0q1TFFEVwSOd7WpGh5vmMRpuP2cdZQrjmEFrtg-1729560527-1.0.1.1-hD81VqTDMu1.Add5pC4YMEGU_DtRPMXygLNCXlQ2E8BW5axUaIYkhoRCv9WVlJ4anVbvkcSdtpMI3a4EBehBPQ; path=\/; expires=Tue, 22-Oct-24 01:58:47 GMT; domain=.api.openai.com; HttpOnly; Secure; SameSite=None", + "_cfuvid=mRRdQJ9aHmYamqkONyzsd9b7.c265OWt3VzncynmLmw-1729560527465-0.0.1.1-604800000; path=\/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None" + ], + "X-Content-Type-Options": "nosniff", + "Server": "cloudflare", + "CF-RAY": "8d65b668eb15c34b-EWR", + "alt-svc": "h3=\":443\"; ma=86400" + }, + "data": "{\n \"id\": \"chatcmpl-AKxzSIWl0HaNUOKyw7yzEu9IDAzTn\",\n \"object\": \"chat.completion\",\n \"created\": 1729560526,\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\\\": \\\"?sdrawkcaB .yas tsuj I did tahw\\\"\\n}\\n```\",\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 150,\n \"completion_tokens\": 25,\n \"total_tokens\": 175,\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/Memory/CollectionMemory-fe703367aa1f98d7884652612a3c77a6.json b/tests/Fixtures/Saloon/Memory/CollectionMemory-fe703367aa1f98d7884652612a3c77a6.json new file mode 100644 index 0000000..39fa424 --- /dev/null +++ b/tests/Fixtures/Saloon/Memory/CollectionMemory-fe703367aa1f98d7884652612a3c77a6.json @@ -0,0 +1,31 @@ +{ + "statusCode": 200, + "headers": { + "Date": "Tue, 22 Oct 2024 01:28:45 GMT", + "Content-Type": "application\/json", + "Content-Length": "699", + "Connection": "keep-alive", + "access-control-expose-headers": "X-Request-ID", + "openai-organization": "user-5hvzt3x5aqwr0picqhxifwl8", + "openai-processing-ms": "645", + "openai-version": "2020-10-01", + "x-ratelimit-limit-requests": "10000", + "x-ratelimit-limit-tokens": "2000000", + "x-ratelimit-remaining-requests": "9999", + "x-ratelimit-remaining-tokens": "1999871", + "x-ratelimit-reset-requests": "6ms", + "x-ratelimit-reset-tokens": "3ms", + "x-request-id": "req_d812e4f7e5835d70aed6a7319b731fdb", + "strict-transport-security": "max-age=31536000; includeSubDomains; preload", + "CF-Cache-Status": "DYNAMIC", + "Set-Cookie": [ + "__cf_bm=Ielj7HJ5UFyX1roQLJHPvepuIehAM00fGDBAtQ5wUVU-1729560525-1.0.1.1-.qJGpK6juks6BfzGmMMeSLlzfRDU63kCPVhOF5y7CacYYgbhGrLLGiyBaW7JC1Ea0Q9SCvgCfbx7t1Tw8V12ww; path=\/; expires=Tue, 22-Oct-24 01:58:45 GMT; domain=.api.openai.com; HttpOnly; Secure; SameSite=None", + "_cfuvid=hpAxlShffUqZT5swLIFFLD939cV0QQyKvtprK1dun0c-1729560525912-0.0.1.1-604800000; path=\/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None" + ], + "X-Content-Type-Options": "nosniff", + "Server": "cloudflare", + "CF-RAY": "8d65b6622f7c41df-EWR", + "alt-svc": "h3=\":443\"; ma=86400" + }, + "data": "{\n \"id\": \"chatcmpl-AKxzRHZJw0xhYEPqhXoMLP3CG36qC\",\n \"object\": \"chat.completion\",\n \"created\": 1729560525,\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\\\": \\\"Hello! How can I assist you today?\\\"\\n}\\n```\",\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 106,\n \"completion_tokens\": 20,\n \"total_tokens\": 126,\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/Memory/ConversationSummaryAgent-5e1fafee7be3b90f42757e4e40abcea4.json b/tests/Fixtures/Saloon/Memory/ConversationSummaryAgent-5e1fafee7be3b90f42757e4e40abcea4.json new file mode 100644 index 0000000..36ab5ff --- /dev/null +++ b/tests/Fixtures/Saloon/Memory/ConversationSummaryAgent-5e1fafee7be3b90f42757e4e40abcea4.json @@ -0,0 +1,31 @@ +{ + "statusCode": 200, + "headers": { + "Date": "Tue, 22 Oct 2024 01:28:48 GMT", + "Content-Type": "application\/json", + "Content-Length": "682", + "Connection": "keep-alive", + "access-control-expose-headers": "X-Request-ID", + "openai-organization": "user-5hvzt3x5aqwr0picqhxifwl8", + "openai-processing-ms": "782", + "openai-version": "2020-10-01", + "x-ratelimit-limit-requests": "10000", + "x-ratelimit-limit-tokens": "2000000", + "x-ratelimit-remaining-requests": "9999", + "x-ratelimit-remaining-tokens": "1999855", + "x-ratelimit-reset-requests": "6ms", + "x-ratelimit-reset-tokens": "4ms", + "x-request-id": "req_c7812bf9445789a39c86210fbbb02ba2", + "strict-transport-security": "max-age=31536000; includeSubDomains; preload", + "CF-Cache-Status": "DYNAMIC", + "Set-Cookie": [ + "__cf_bm=vuy4vyIq7RR3thK2Hzr_6J1hGYcEVU_sOOMbQ94NTXg-1729560528-1.0.1.1-vXusK_QAoRJAlUc2d61BTJEv22ljCbPqGqZoBwxvNYoAaQph_P1KsD3_6Ax7tKQFFcHat7.bs4_JQ7w7uKfFPA; path=\/; expires=Tue, 22-Oct-24 01:58:48 GMT; domain=.api.openai.com; HttpOnly; Secure; SameSite=None", + "_cfuvid=YNNn.6fLfYYGc6dNguQNAetq7vf_sfGPlEG5d0haaiM-1729560528726-0.0.1.1-604800000; path=\/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None" + ], + "X-Content-Type-Options": "nosniff", + "Server": "cloudflare", + "CF-RAY": "8d65b672eb6d0ca5-EWR", + "alt-svc": "h3=\":443\"; ma=86400" + }, + "data": "{\n \"id\": \"chatcmpl-AKxzTjkbWKh9ao64cOPWDIRov1GFG\",\n \"object\": \"chat.completion\",\n \"created\": 1729560527,\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\\\": \\\"hello this a test\\\"\\n}\\n```\",\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 120,\n \"completion_tokens\": 16,\n \"total_tokens\": 136,\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/Memory/ConversationSummaryAgent-6ca314ac196be36057a2a956836a6d8d.json b/tests/Fixtures/Saloon/Memory/ConversationSummaryAgent-6ca314ac196be36057a2a956836a6d8d.json new file mode 100644 index 0000000..cb3ccea --- /dev/null +++ b/tests/Fixtures/Saloon/Memory/ConversationSummaryAgent-6ca314ac196be36057a2a956836a6d8d.json @@ -0,0 +1,31 @@ +{ + "statusCode": 200, + "headers": { + "Date": "Tue, 22 Oct 2024 01:28:49 GMT", + "Content-Type": "application\/json", + "Content-Length": "724", + "Connection": "keep-alive", + "access-control-expose-headers": "X-Request-ID", + "openai-organization": "user-5hvzt3x5aqwr0picqhxifwl8", + "openai-processing-ms": "881", + "openai-version": "2020-10-01", + "x-ratelimit-limit-requests": "10000", + "x-ratelimit-limit-tokens": "2000000", + "x-ratelimit-remaining-requests": "9999", + "x-ratelimit-remaining-tokens": "1999894", + "x-ratelimit-reset-requests": "6ms", + "x-ratelimit-reset-tokens": "3ms", + "x-request-id": "req_f83f9d9c34d6b164e361587b3194c7af", + "strict-transport-security": "max-age=31536000; includeSubDomains; preload", + "CF-Cache-Status": "DYNAMIC", + "Set-Cookie": [ + "__cf_bm=HtQfe9ZEiZRCCxBzOSUp6AaDT15vacOa0Jrght_B7WI-1729560529-1.0.1.1-9cn0ZEeutOeWovN1MNo4EYz_xlc3h9hGQ4ju.PEYGWEnXa.HMK7f5CauVgD2bx1uWkx1AchpRuQUITNTQruXrw; path=\/; expires=Tue, 22-Oct-24 01:58:49 GMT; domain=.api.openai.com; HttpOnly; Secure; SameSite=None", + "_cfuvid=x3it8V3bVr3kFFkcvhsJFqwaohKwUwxnzlqRKwrnX5c-1729560529986-0.0.1.1-604800000; path=\/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None" + ], + "X-Content-Type-Options": "nosniff", + "Server": "cloudflare", + "CF-RAY": "8d65b67a2cd67c7c-EWR", + "alt-svc": "h3=\":443\"; ma=86400" + }, + "data": "{\n \"id\": \"chatcmpl-AKxzVUNoLmGtlakUONmSyPFdxE77l\",\n \"object\": \"chat.completion\",\n \"created\": 1729560529,\n \"model\": \"gpt-4-turbo-2024-04-09\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"The user's message says \\\"hello this a test\\\" and the assistant responds with \\\"hello this a test\\\".\",\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 92,\n \"completion_tokens\": 22,\n \"total_tokens\": 114,\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/Memory/ConversationSummaryAgent-88c99971ec0d20928a13254ec24d91e8.json b/tests/Fixtures/Saloon/Memory/ConversationSummaryAgent-88c99971ec0d20928a13254ec24d91e8.json new file mode 100644 index 0000000..07e1751 --- /dev/null +++ b/tests/Fixtures/Saloon/Memory/ConversationSummaryAgent-88c99971ec0d20928a13254ec24d91e8.json @@ -0,0 +1,31 @@ +{ + "statusCode": 200, + "headers": { + "Date": "Tue, 22 Oct 2024 01:37:06 GMT", + "Content-Type": "application/json", + "Content-Length": "685", + "Connection": "keep-alive", + "access-control-expose-headers": "X-Request-ID", + "openai-organization": "user-5hvzt3x5aqwr0picqhxifwl8", + "openai-processing-ms": "771", + "openai-version": "2020-10-01", + "x-ratelimit-limit-requests": "10000", + "x-ratelimit-limit-tokens": "2000000", + "x-ratelimit-remaining-requests": "9999", + "x-ratelimit-remaining-tokens": "1999823", + "x-ratelimit-reset-requests": "6ms", + "x-ratelimit-reset-tokens": "5ms", + "x-request-id": "req_73a10708637cf068130b21f6669e743f", + "strict-transport-security": "max-age=31536000; includeSubDomains; preload", + "CF-Cache-Status": "DYNAMIC", + "Set-Cookie": [ + "__cf_bm=3fwN9kpVCyPDQJhUiCamWKqbcSsggIgxPiiZE.w7JZw-1729561026-1.0.1.1-NBAd0kJoT5QobhbxtZKuFzpzdRv1cW4YOKDmR7jvF4AMfwh8d544347KfZ5fDxdQ5Cguws6HgzSodoJbwnx7tQ; path=/; expires=Tue, 22-Oct-24 02:07:06 GMT; domain=.api.openai.com; HttpOnly; Secure; SameSite=None", + "_cfuvid=SKvmXa0uw5GlONqiHtr.U.b26KyZqKzyQvOSCzlTDcU-1729561026829-0.0.1.1-604800000; path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None" + ], + "X-Content-Type-Options": "nosniff", + "Server": "cloudflare", + "CF-RAY": "8d65c29c0f3442b1-EWR", + "alt-svc": "h3=\":443\"; ma=86400" + }, + "data": "{\n \"id\": \"chatcmpl-AKy7WsTDIkDUCG08tPr8OF7dz8gX6\",\n \"object\": \"chat.completion\",\n \"created\": 1729561026,\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\\\": \\\"tset a si siht olleh\\\"\\n}\\n```\",\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 149,\n \"completion_tokens\": 20,\n \"total_tokens\": 169,\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/Memory/ConversationSummaryAgent-bd12160cf0d4298d6b5dc4e13ae5a14d.json b/tests/Fixtures/Saloon/Memory/ConversationSummaryAgent-bd12160cf0d4298d6b5dc4e13ae5a14d.json new file mode 100644 index 0000000..ea54acd --- /dev/null +++ b/tests/Fixtures/Saloon/Memory/ConversationSummaryAgent-bd12160cf0d4298d6b5dc4e13ae5a14d.json @@ -0,0 +1,31 @@ +{ + "statusCode": 200, + "headers": { + "Date": "Tue, 22 Oct 2024 01:37:05 GMT", + "Content-Type": "application\/json", + "Content-Length": "779", + "Connection": "keep-alive", + "access-control-expose-headers": "X-Request-ID", + "openai-organization": "user-5hvzt3x5aqwr0picqhxifwl8", + "openai-processing-ms": "1096", + "openai-version": "2020-10-01", + "x-ratelimit-limit-requests": "10000", + "x-ratelimit-limit-tokens": "2000000", + "x-ratelimit-remaining-requests": "9999", + "x-ratelimit-remaining-tokens": "1999888", + "x-ratelimit-reset-requests": "6ms", + "x-ratelimit-reset-tokens": "3ms", + "x-request-id": "req_021c6924d94bd0e3ee0f06bc3db4c4bc", + "strict-transport-security": "max-age=31536000; includeSubDomains; preload", + "CF-Cache-Status": "DYNAMIC", + "Set-Cookie": [ + "__cf_bm=vL__r5ubJvNV4RmlJZhNFqArDwX6GyxVKpi.q4yM0nI-1729561025-1.0.1.1-UpZdTgW2r55OFqoyho_c5ivHOoQRN8ljHmOPcECcUNlMcWmNp6zCSPvljzEVxxSgqJC6yW8kTDEo16cfyjxN8g; path=\/; expires=Tue, 22-Oct-24 02:07:05 GMT; domain=.api.openai.com; HttpOnly; Secure; SameSite=None", + "_cfuvid=8YjaCofLksiUzxQCu0C5XWrc1Q8tEXkO1xPJxxx0MkQ-1729561025666-0.0.1.1-604800000; path=\/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None" + ], + "X-Content-Type-Options": "nosniff", + "Server": "cloudflare", + "CF-RAY": "8d65c292d9c11a38-EWR", + "alt-svc": "h3=\":443\"; ma=86400" + }, + "data": "{\n \"id\": \"chatcmpl-AKy7Uc6De3D1gSPOHQZTYrQkiA2Ek\",\n \"object\": \"chat.completion\",\n \"created\": 1729561024,\n \"model\": \"gpt-4-turbo-2024-04-09\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"The user's message says \\\"hello this a test\\\" and the assistant responds with \\\"hello this a test\\\". The user then asks what they just said, but backwards.\",\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 93,\n \"completion_tokens\": 34,\n \"total_tokens\": 127,\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/Memory/ConversationSummaryAgent-f35bc9bf07dc805cedb1cbda219d7a63.json b/tests/Fixtures/Saloon/Memory/ConversationSummaryAgent-f35bc9bf07dc805cedb1cbda219d7a63.json new file mode 100644 index 0000000..1143710 --- /dev/null +++ b/tests/Fixtures/Saloon/Memory/ConversationSummaryAgent-f35bc9bf07dc805cedb1cbda219d7a63.json @@ -0,0 +1,31 @@ +{ + "statusCode": 200, + "headers": { + "Date": "Tue, 22 Oct 2024 01:37:08 GMT", + "Content-Type": "application\/json", + "Content-Length": "833", + "Connection": "keep-alive", + "access-control-expose-headers": "X-Request-ID", + "openai-organization": "user-5hvzt3x5aqwr0picqhxifwl8", + "openai-processing-ms": "1472", + "openai-version": "2020-10-01", + "x-ratelimit-limit-requests": "10000", + "x-ratelimit-limit-tokens": "2000000", + "x-ratelimit-remaining-requests": "9999", + "x-ratelimit-remaining-tokens": "1999867", + "x-ratelimit-reset-requests": "6ms", + "x-ratelimit-reset-tokens": "3ms", + "x-request-id": "req_141298f6aa078e29d1afc0e0b3e13a4a", + "strict-transport-security": "max-age=31536000; includeSubDomains; preload", + "CF-Cache-Status": "DYNAMIC", + "Set-Cookie": [ + "__cf_bm=Xq_.3B8FFYh0icDGV9BMRsG1XRoKWpn4FR.vPbsrIqY-1729561028-1.0.1.1-CmRScxLczHkErR45.scYJkcdTj8L4HmoXsNAJYSH.p39nsm97GqsK.7PE3JBCZkVJPtVJmhK.9iv_Phn58kQnQ; path=\/; expires=Tue, 22-Oct-24 02:07:08 GMT; domain=.api.openai.com; HttpOnly; Secure; SameSite=None", + "_cfuvid=VQUYWMFih3MXgQW2g18Iiz7Cz5VtxZsT0Bn09DAcTzM-1729561028760-0.0.1.1-604800000; path=\/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None" + ], + "X-Content-Type-Options": "nosniff", + "Server": "cloudflare", + "CF-RAY": "8d65c2a3c9e17d02-EWR", + "alt-svc": "h3=\":443\"; ma=86400" + }, + "data": "{\n \"id\": \"chatcmpl-AKy7X6AksadnNQ8O5xKbFuIWTJdz3\",\n \"object\": \"chat.completion\",\n \"created\": 1729561027,\n \"model\": \"gpt-4-turbo-2024-04-09\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"The user's message says \\\"hello this a test\\\" and the assistant responds with \\\"hello this a test\\\". The user then asks what they just said, but backwards. The assistant answers with \\\"tset a si siht olleh\\\".\",\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 119,\n \"completion_tokens\": 48,\n \"total_tokens\": 167,\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/Memory/ConversationSummaryWithToolsAgent-361cb03b53000189489aa04c089c26a1.json b/tests/Fixtures/Saloon/Memory/ConversationSummaryWithToolsAgent-361cb03b53000189489aa04c089c26a1.json deleted file mode 100644 index 4c7d9bd..0000000 --- a/tests/Fixtures/Saloon/Memory/ConversationSummaryWithToolsAgent-361cb03b53000189489aa04c089c26a1.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "statusCode": 200, - "headers": { - "Date": "Fri, 11 Oct 2024 22:34:41 GMT", - "Content-Type": "application\/json", - "Content-Length": "985", - "Connection": "keep-alive" - }, - "data": "{\n \"id\": \"chatcmpl-AHIVUZDWCiWxggGTOMOGL06WCmA1L\",\n \"object\": \"chat.completion\",\n \"created\": 1728686080,\n \"model\": \"gpt-4-turbo-2024-04-09\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": null,\n \"tool_calls\": [\n {\n \"id\": \"call_sGAiqxpXryyAMQ8pUpsBztuZ\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"serper_tool\",\n \"arguments\": \"{\\\"query\\\":\\\"current president of the united states\\\",\\\"searchType\\\":\\\"search\\\",\\\"numberOfResults\\\":10}\"\n }\n }\n ],\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"tool_calls\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 208,\n \"completion_tokens\": 30,\n \"total_tokens\": 238,\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/Memory/ConversationSummaryWithToolsAgent-36440b3fabab462e10a0388479c20807.json b/tests/Fixtures/Saloon/Memory/ConversationSummaryWithToolsAgent-36440b3fabab462e10a0388479c20807.json new file mode 100644 index 0000000..d160882 --- /dev/null +++ b/tests/Fixtures/Saloon/Memory/ConversationSummaryWithToolsAgent-36440b3fabab462e10a0388479c20807.json @@ -0,0 +1,10 @@ +{ + "statusCode": 200, + "headers": { + "Date": "Tue, 22 Oct 2024 01:41:40 GMT", + "Content-Type": "application\/json", + "Content-Length": "819", + "Connection": "keep-alive" + }, + "data": "{\n \"id\": \"chatcmpl-AKyBvNyXTas4ANlvgTA60GGx5TYKp\",\n \"object\": \"chat.completion\",\n \"created\": 1729561299,\n \"model\": \"gpt-4-turbo-2024-04-09\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"The user wanted to know about the Vice President following the confirmation that Joe Biden is the current President of the United States. The Vice President following Joe Biden is Kamala Harris.\",\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 116,\n \"completion_tokens\": 35,\n \"total_tokens\": 151,\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/Memory/ConversationSummaryWithToolsAgent-3f8c0c12b69505b54362d103f3a51e7b.json b/tests/Fixtures/Saloon/Memory/ConversationSummaryWithToolsAgent-3f8c0c12b69505b54362d103f3a51e7b.json deleted file mode 100644 index a23934c..0000000 --- a/tests/Fixtures/Saloon/Memory/ConversationSummaryWithToolsAgent-3f8c0c12b69505b54362d103f3a51e7b.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "statusCode": 200, - "headers": { - "Date": "Fri, 11 Oct 2024 22:34:45 GMT", - "Content-Type": "application/json", - "Content-Length": "940", - "Connection": "keep-alive" - }, - "data": "{\n \"id\": \"chatcmpl-AHIVXOCogrmX3XaWAZRFueIlXrVyt\",\n \"object\": \"chat.completion\",\n \"created\": 1728686083,\n \"model\": \"gpt-4-turbo-2024-04-09\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"The user requested to search Google to find out who the current President of the United States is. The search returned results identifying Joe Biden as the current President, serving as the 46th president since 2021. Various sources including the official White House website and Wikipedia confirm this information.\",\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 760,\n \"completion_tokens\": 57,\n \"total_tokens\": 817,\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/Memory/ConversationSummaryWithToolsAgent-47c33ba83a48790e1c7369c546e364d1.json b/tests/Fixtures/Saloon/Memory/ConversationSummaryWithToolsAgent-47c33ba83a48790e1c7369c546e364d1.json new file mode 100644 index 0000000..c916253 --- /dev/null +++ b/tests/Fixtures/Saloon/Memory/ConversationSummaryWithToolsAgent-47c33ba83a48790e1c7369c546e364d1.json @@ -0,0 +1,10 @@ +{ + "statusCode": 200, + "headers": { + "Date": "Tue, 22 Oct 2024 01:40:59 GMT", + "Content-Type": "application\/json", + "Content-Length": "721", + "Connection": "keep-alive" + }, + "data": "{\n \"id\": \"chatcmpl-AKyBGdiiK67EBTKsg030yafl8AuPZ\",\n \"object\": \"chat.completion\",\n \"created\": 1729561258,\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 is the current President of the United States.\\\"\\n}\\n```\",\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 951,\n \"completion_tokens\": 23,\n \"total_tokens\": 974,\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/Memory/ConversationSummaryWithToolsAgent-4dd943e799ab1c294682801edb307f4e.json b/tests/Fixtures/Saloon/Memory/ConversationSummaryWithToolsAgent-4dd943e799ab1c294682801edb307f4e.json new file mode 100644 index 0000000..059c141 --- /dev/null +++ b/tests/Fixtures/Saloon/Memory/ConversationSummaryWithToolsAgent-4dd943e799ab1c294682801edb307f4e.json @@ -0,0 +1,10 @@ +{ + "statusCode": 200, + "headers": { + "Date": "Tue, 22 Oct 2024 01:40:55 GMT", + "Content-Type": "application\/json", + "Content-Length": "936", + "Connection": "keep-alive" + }, + "data": "{\n \"id\": \"chatcmpl-AKyBCkD8mMFwheZaD8OYJ4wrwVkca\",\n \"object\": \"chat.completion\",\n \"created\": 1729561254,\n \"model\": \"gpt-4-turbo-2024-04-09\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": null,\n \"tool_calls\": [\n {\n \"id\": \"call_VgLPDzWdffoRI5faDGoGVHOV\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"serper_tool\",\n \"arguments\": \"{\\\"query\\\":\\\"current President of the United States\\\"}\"\n }\n }\n ],\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"tool_calls\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 239,\n \"completion_tokens\": 20,\n \"total_tokens\": 259,\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/Memory/ConversationSummaryWithToolsAgent-562ade78c2360bd7cbbc37648f839fe1.json b/tests/Fixtures/Saloon/Memory/ConversationSummaryWithToolsAgent-562ade78c2360bd7cbbc37648f839fe1.json deleted file mode 100644 index d2f8383..0000000 --- a/tests/Fixtures/Saloon/Memory/ConversationSummaryWithToolsAgent-562ade78c2360bd7cbbc37648f839fe1.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "statusCode": 200, - "headers": { - "Date": "Fri, 11 Oct 2024 22:36:08 GMT", - "Content-Type": "application/json", - "Content-Length": "750", - "Connection": "keep-alive" - }, - "data": "{\n \"id\": \"chatcmpl-AHIWty2ykO59OFa763UaRmpqvhR33\",\n \"object\": \"chat.completion\",\n \"created\": 1728686167,\n \"model\": \"gpt-4-turbo-2024-04-09\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"The user inquired about the current Vice President of the United States following their earlier question about the President.\",\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 139,\n \"completion_tokens\": 21,\n \"total_tokens\": 160,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0\n }\n },\n \"system_fingerprint\": \"fp_4dba7dd7b3\"\n}\n" -} diff --git a/tests/Fixtures/Saloon/Memory/ConversationSummaryWithToolsAgent-6726bfe6ce3c103bd341c7fc1cb24582.json b/tests/Fixtures/Saloon/Memory/ConversationSummaryWithToolsAgent-6726bfe6ce3c103bd341c7fc1cb24582.json deleted file mode 100644 index 42ba56e..0000000 --- a/tests/Fixtures/Saloon/Memory/ConversationSummaryWithToolsAgent-6726bfe6ce3c103bd341c7fc1cb24582.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "statusCode": 200, - "headers": { - "Date": "Fri, 11 Oct 2024 22:36:09 GMT", - "Content-Type": "application\/json", - "Content-Length": "716", - "Connection": "keep-alive" - }, - "data": "{\n \"id\": \"chatcmpl-AHIWvSEj35LKuH3iqZGdrshBOwAYH\",\n \"object\": \"chat.completion\",\n \"created\": 1728686169,\n \"model\": \"gpt-4-turbo-2024-04-09\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"{\\n \\\"answer\\\": \\\"The current Vice President of the United States is Kamala Harris.\\\"\\n}\",\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 205,\n \"completion_tokens\": 21,\n \"total_tokens\": 226,\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/Memory/ConversationSummaryWithToolsAgent-840fbdc622785ce8eaf6265ec38b373a.json b/tests/Fixtures/Saloon/Memory/ConversationSummaryWithToolsAgent-840fbdc622785ce8eaf6265ec38b373a.json new file mode 100644 index 0000000..91c1f56 --- /dev/null +++ b/tests/Fixtures/Saloon/Memory/ConversationSummaryWithToolsAgent-840fbdc622785ce8eaf6265ec38b373a.json @@ -0,0 +1,10 @@ +{ + "statusCode": 200, + "headers": { + "Date": "Tue, 22 Oct 2024 01:41:02 GMT", + "Content-Type": "application\/json", + "Content-Length": "978", + "Connection": "keep-alive" + }, + "data": "{\n \"id\": \"chatcmpl-AKyBI2IiSzAG6L22hN0DGbHe3qaFO\",\n \"object\": \"chat.completion\",\n \"created\": 1729561260,\n \"model\": \"gpt-4-turbo-2024-04-09\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"The user requested to search Google for the current President of the United States. Using the serper_tool, the results showed multiple references confirming that Joe Biden is the current President of the United States, serving as the 46th president since 2021. The assistant confirmed that Joe Biden is indeed the current President of the United States.\",\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 139,\n \"completion_tokens\": 67,\n \"total_tokens\": 206,\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/Memory/ConversationSummaryWithToolsAgent-991e3ebf644dfe01a68fc39669e07299.json b/tests/Fixtures/Saloon/Memory/ConversationSummaryWithToolsAgent-991e3ebf644dfe01a68fc39669e07299.json new file mode 100644 index 0000000..5fabd19 --- /dev/null +++ b/tests/Fixtures/Saloon/Memory/ConversationSummaryWithToolsAgent-991e3ebf644dfe01a68fc39669e07299.json @@ -0,0 +1,10 @@ +{ + "statusCode": 200, + "headers": { + "Date": "Tue, 22 Oct 2024 01:41:39 GMT", + "Content-Type": "application/json", + "Content-Length": "742", + "Connection": "keep-alive" + }, + "data": "{\n \"id\": \"chatcmpl-AKyBuVmdBNnW5ohHS3bvE7exLroho\",\n \"object\": \"chat.completion\",\n \"created\": 1729561298,\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\\\": \\\"The Vice President of the United States following Joe Biden is Kamala Harris.\\\"\\n}\\n```\",\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 243,\n \"completion_tokens\": 27,\n \"total_tokens\": 270,\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/Memory/ConversationSummaryWithToolsAgent-b40be9f8397780e2392c2036ccc6edf5.json b/tests/Fixtures/Saloon/Memory/ConversationSummaryWithToolsAgent-b40be9f8397780e2392c2036ccc6edf5.json deleted file mode 100644 index d570be8..0000000 --- a/tests/Fixtures/Saloon/Memory/ConversationSummaryWithToolsAgent-b40be9f8397780e2392c2036ccc6edf5.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "statusCode": 200, - "headers": { - "Date": "Fri, 11 Oct 2024 22:36:11 GMT", - "Content-Type": "application/json", - "Content-Length": "817", - "Connection": "keep-alive" - }, - "data": "{\n \"id\": \"chatcmpl-AHIWwqsNAFB9fGrSMnuJqHuIWmEuB\",\n \"object\": \"chat.completion\",\n \"created\": 1728686170,\n \"model\": \"gpt-4-turbo-2024-04-09\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"The user inquired about the current Vice President of the United States following their earlier question about the President, and was informed that the current Vice President is Kamala Harris.\",\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 106,\n \"completion_tokens\": 34,\n \"total_tokens\": 140,\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/Memory/ConversationSummaryWithToolsAgent-b906c3b4c8019936fe115e4e62d3994c.json b/tests/Fixtures/Saloon/Memory/ConversationSummaryWithToolsAgent-b906c3b4c8019936fe115e4e62d3994c.json new file mode 100644 index 0000000..7120493 --- /dev/null +++ b/tests/Fixtures/Saloon/Memory/ConversationSummaryWithToolsAgent-b906c3b4c8019936fe115e4e62d3994c.json @@ -0,0 +1,10 @@ +{ + "statusCode": 200, + "headers": { + "Date": "Tue, 22 Oct 2024 01:41:38 GMT", + "Content-Type": "application\/json", + "Content-Length": "762", + "Connection": "keep-alive" + }, + "data": "{\n \"id\": \"chatcmpl-AKyBtzdOThyrXdQHyqVduKWsGLQCn\",\n \"object\": \"chat.completion\",\n \"created\": 1729561297,\n \"model\": \"gpt-4-turbo-2024-04-09\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"The user wanted to know about the Vice President following the confirmation that Joe Biden is the current President of the United States.\",\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 134,\n \"completion_tokens\": 24,\n \"total_tokens\": 158,\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/Memory/ConversationSummaryWithToolsAgent-be73eeb4134d415deb87198d861da0e5.json b/tests/Fixtures/Saloon/Memory/ConversationSummaryWithToolsAgent-be73eeb4134d415deb87198d861da0e5.json deleted file mode 100644 index a8a4738..0000000 --- a/tests/Fixtures/Saloon/Memory/ConversationSummaryWithToolsAgent-be73eeb4134d415deb87198d861da0e5.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "statusCode": 200, - "headers": { - "Date": "Fri, 11 Oct 2024 22:34:50 GMT", - "Content-Type": "application/json", - "Content-Length": "1025", - "Connection": "keep-alive" - }, - "data": "{\n \"id\": \"chatcmpl-AHIVbXfjdSkcqTXgZy45c0tqRXt5A\",\n \"object\": \"chat.completion\",\n \"created\": 1728686087,\n \"model\": \"gpt-4-turbo-2024-04-09\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"The user requested to search Google to find out who the current President of the United States is. The search returned results identifying Joe Biden as the current President, serving as the 46th president since 2021. Various sources including the official White House website and Wikipedia confirm this information. The assistant affirmed that Joe Biden is the current President of the United States.\",\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 145,\n \"completion_tokens\": 72,\n \"total_tokens\": 217,\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/Memory/ConversationSummaryWithToolsAgent-c41690838a1b7fb558ef8fc89647ff0d.json b/tests/Fixtures/Saloon/Memory/ConversationSummaryWithToolsAgent-c41690838a1b7fb558ef8fc89647ff0d.json deleted file mode 100644 index f6c1452..0000000 --- a/tests/Fixtures/Saloon/Memory/ConversationSummaryWithToolsAgent-c41690838a1b7fb558ef8fc89647ff0d.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "statusCode": 200, - "headers": { - "Date": "Fri, 11 Oct 2024 22:34:47 GMT", - "Content-Type": "application/json", - "Content-Length": "721", - "Connection": "keep-alive" - }, - "data": "{\n \"id\": \"chatcmpl-AHIVaMZV0bHQlNWJYRBNcnZTYPXxG\",\n \"object\": \"chat.completion\",\n \"created\": 1728686086,\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 is the current President of the United States.\\\"\\n}\\n```\",\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 932,\n \"completion_tokens\": 23,\n \"total_tokens\": 955,\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/Memory/ConversationSummaryWithToolsAgent-de2f99ba9fd74f13849ee043bcee4bdf.json b/tests/Fixtures/Saloon/Memory/ConversationSummaryWithToolsAgent-de2f99ba9fd74f13849ee043bcee4bdf.json index a40d955..b43fa9a 100644 --- a/tests/Fixtures/Saloon/Memory/ConversationSummaryWithToolsAgent-de2f99ba9fd74f13849ee043bcee4bdf.json +++ b/tests/Fixtures/Saloon/Memory/ConversationSummaryWithToolsAgent-de2f99ba9fd74f13849ee043bcee4bdf.json @@ -1,10 +1,10 @@ { "statusCode": 200, "headers": { - "Date": "Fri, 11 Oct 2024 22:34:39 GMT", + "Date": "Tue, 22 Oct 2024 01:40:54 GMT", "Content-Type": "application\/json", - "Content-Length": "721", + "Content-Length": "706", "Connection": "keep-alive" }, - "data": "{\n \"id\": \"chatcmpl-AHIVSqpZCFmGOji9pRHeaDeBovJBD\",\n \"object\": \"chat.completion\",\n \"created\": 1728686078,\n \"model\": \"gpt-4-turbo-2024-04-09\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"The user requested to search Google to find out who the current President of the United States is.\",\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 54,\n \"completion_tokens\": 19,\n \"total_tokens\": 73,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0\n }\n },\n \"system_fingerprint\": \"fp_4dba7dd7b3\"\n}\n" + "data": "{\n \"id\": \"chatcmpl-AKyBBDJ6NEok04RrR1sqhDRtUNmqc\",\n \"object\": \"chat.completion\",\n \"created\": 1729561253,\n \"model\": \"gpt-4-turbo-2024-04-09\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"The user requested to search Google for the current President of the United States.\",\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 54,\n \"completion_tokens\": 15,\n \"total_tokens\": 69,\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/Memory/ConversationSummaryWithToolsAgent-ee890dab1469e9a09f9960cb3f09bf6d.json b/tests/Fixtures/Saloon/Memory/ConversationSummaryWithToolsAgent-ee890dab1469e9a09f9960cb3f09bf6d.json new file mode 100644 index 0000000..ad35bfd --- /dev/null +++ b/tests/Fixtures/Saloon/Memory/ConversationSummaryWithToolsAgent-ee890dab1469e9a09f9960cb3f09bf6d.json @@ -0,0 +1,10 @@ +{ + "statusCode": 200, + "headers": { + "Date": "Tue, 22 Oct 2024 01:40:57 GMT", + "Content-Type": "application/json", + "Content-Length": "885", + "Connection": "keep-alive" + }, + "data": "{\n \"id\": \"chatcmpl-AKyBEvI5AofCNQk8dGLLqHG5TsQt7\",\n \"object\": \"chat.completion\",\n \"created\": 1729561256,\n \"model\": \"gpt-4-turbo-2024-04-09\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"The user requested to search Google for the current President of the United States. Using the serper_tool, the results showed multiple references confirming that Joe Biden is the current President of the United States, serving as the 46th president since 2021.\",\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 746,\n \"completion_tokens\": 51,\n \"total_tokens\": 797,\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/Memory/DatabaseMemory-495ba0207bd93966fcb5547c5509fadb.json b/tests/Fixtures/Saloon/Memory/DatabaseMemory-495ba0207bd93966fcb5547c5509fadb.json new file mode 100644 index 0000000..50e82b6 --- /dev/null +++ b/tests/Fixtures/Saloon/Memory/DatabaseMemory-495ba0207bd93966fcb5547c5509fadb.json @@ -0,0 +1,31 @@ +{ + "statusCode": 200, + "headers": { + "Date": "Tue, 22 Oct 2024 01:28:59 GMT", + "Content-Type": "application/json", + "Content-Length": "700", + "Connection": "keep-alive", + "access-control-expose-headers": "X-Request-ID", + "openai-organization": "user-5hvzt3x5aqwr0picqhxifwl8", + "openai-processing-ms": "814", + "openai-version": "2020-10-01", + "x-ratelimit-limit-requests": "10000", + "x-ratelimit-limit-tokens": "2000000", + "x-ratelimit-remaining-requests": "9999", + "x-ratelimit-remaining-tokens": "1999867", + "x-ratelimit-reset-requests": "6ms", + "x-ratelimit-reset-tokens": "3ms", + "x-request-id": "req_a4bac68eb7d7a76ad2a793e80a8218b1", + "strict-transport-security": "max-age=31536000; includeSubDomains; preload", + "CF-Cache-Status": "DYNAMIC", + "Set-Cookie": [ + "__cf_bm=2x1PuHrqwDqQco4Ix1Eulg_5eOvLN4LGQm6XNJtm69M-1729560539-1.0.1.1-FWGy71BtK4BF6u5pxEmeYbY.YMaAddyBqjc_E1a.AYmnQtfhG.v0s_mmGfT1V3GuId1hka1EtP3ppY3yOnU3Pw; path=/; expires=Tue, 22-Oct-24 01:58:59 GMT; domain=.api.openai.com; HttpOnly; Secure; SameSite=None", + "_cfuvid=09Iz6Fidm4vDRcvj4rhCfC4qlyVsjpHqz68CeTqpAXc-1729560539653-0.0.1.1-604800000; path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None" + ], + "X-Content-Type-Options": "nosniff", + "Server": "cloudflare", + "CF-RAY": "8d65b6b6fc6b3344-EWR", + "alt-svc": "h3=\":443\"; ma=86400" + }, + "data": "{\n \"id\": \"chatcmpl-AKxzeRQRG836TY7nG3trfn43Nk5Us\",\n \"object\": \"chat.completion\",\n \"created\": 1729560538,\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\\\": \\\".sdrawkcab tuB ?yas tsuj I did tahw\\\"\\n}\\n```\",\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 112,\n \"completion_tokens\": 26,\n \"total_tokens\": 138,\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/Memory/DatabaseMemory-fe703367aa1f98d7884652612a3c77a6.json b/tests/Fixtures/Saloon/Memory/DatabaseMemory-fe703367aa1f98d7884652612a3c77a6.json new file mode 100644 index 0000000..68a13a8 --- /dev/null +++ b/tests/Fixtures/Saloon/Memory/DatabaseMemory-fe703367aa1f98d7884652612a3c77a6.json @@ -0,0 +1,31 @@ +{ + "statusCode": 200, + "headers": { + "Date": "Tue, 22 Oct 2024 01:28:58 GMT", + "Content-Type": "application/json", + "Content-Length": "699", + "Connection": "keep-alive", + "access-control-expose-headers": "X-Request-ID", + "openai-organization": "user-5hvzt3x5aqwr0picqhxifwl8", + "openai-processing-ms": "713", + "openai-version": "2020-10-01", + "x-ratelimit-limit-requests": "10000", + "x-ratelimit-limit-tokens": "2000000", + "x-ratelimit-remaining-requests": "9999", + "x-ratelimit-remaining-tokens": "1999871", + "x-ratelimit-reset-requests": "6ms", + "x-ratelimit-reset-tokens": "3ms", + "x-request-id": "req_0ad66874bca30e90a762f870164e6daf", + "strict-transport-security": "max-age=31536000; includeSubDomains; preload", + "CF-Cache-Status": "DYNAMIC", + "Set-Cookie": [ + "__cf_bm=eYiKNfU2u7krCUQda0_2IGklMhCJJcQ.s.ZO_4Ov.Ig-1729560538-1.0.1.1-TPvjywQitZ6hfmN_fhOYM6Ohm2KJpB02G_4zvFFxN7BWGOvOpkQhlFcRxObcLnHkD9oIvPHxKaUGKHTLV3XYKg; path=/; expires=Tue, 22-Oct-24 01:58:58 GMT; domain=.api.openai.com; HttpOnly; Secure; SameSite=None", + "_cfuvid=mqdo9Lfc5FHkdb5ZItd6Gd4zVDZli7BgWgoD3Oy2u74-1729560538317-0.0.1.1-604800000; path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None" + ], + "X-Content-Type-Options": "nosniff", + "Server": "cloudflare", + "CF-RAY": "8d65b6af4a8e7279-EWR", + "alt-svc": "h3=\":443\"; ma=86400" + }, + "data": "{\n \"id\": \"chatcmpl-AKxzdkhKVl4ZdLbXJgpaPc7lEK1wQ\",\n \"object\": \"chat.completion\",\n \"created\": 1729560537,\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\\\": \\\"Hello! How can I assist you today?\\\"\\n}\\n```\",\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 106,\n \"completion_tokens\": 20,\n \"total_tokens\": 126,\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/Tools/ClearbitCompanyTool-4844006bb7346a8cd4946135a26bb2f2.json b/tests/Fixtures/Saloon/Tools/ClearbitCompanyTool-4844006bb7346a8cd4946135a26bb2f2.json new file mode 100644 index 0000000..9eea816 --- /dev/null +++ b/tests/Fixtures/Saloon/Tools/ClearbitCompanyTool-4844006bb7346a8cd4946135a26bb2f2.json @@ -0,0 +1,31 @@ +{ + "statusCode": 200, + "headers": { + "Date": "Tue, 22 Oct 2024 01:29:05 GMT", + "Content-Type": "application\/json", + "Content-Length": "1181", + "Connection": "keep-alive", + "access-control-expose-headers": "X-Request-ID", + "openai-organization": "user-5hvzt3x5aqwr0picqhxifwl8", + "openai-processing-ms": "3842", + "openai-version": "2020-10-01", + "x-ratelimit-limit-requests": "10000", + "x-ratelimit-limit-tokens": "2000000", + "x-ratelimit-remaining-requests": "9999", + "x-ratelimit-remaining-tokens": "1999764", + "x-ratelimit-reset-requests": "6ms", + "x-ratelimit-reset-tokens": "7ms", + "x-request-id": "req_ac23ffb783a250f76b95115937089a7e", + "strict-transport-security": "max-age=31536000; includeSubDomains; preload", + "CF-Cache-Status": "DYNAMIC", + "Set-Cookie": [ + "__cf_bm=Us0iTr53ncmzPI8qVv.1x9gVdpPlJR5GeAy5hjlRbKI-1729560545-1.0.1.1-.0NSN.9zujuAIUPwIRDuGHoncs0LiyKBgnHv1SaRAmVsY8yH_G3KUmjfM6evehR2C1aoLhBREPPm5BmOLUgBIw; path=\/; expires=Tue, 22-Oct-24 01:59:05 GMT; domain=.api.openai.com; HttpOnly; Secure; SameSite=None", + "_cfuvid=JUryU1x.ZbpzxhkUdSU1hFX4eOsscQQdP23.AuOAq_o-1729560545365-0.0.1.1-604800000; path=\/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None" + ], + "X-Content-Type-Options": "nosniff", + "Server": "cloudflare", + "CF-RAY": "8d65b6c689a88c81-EWR", + "alt-svc": "h3=\":443\"; ma=86400" + }, + "data": "{\n \"id\": \"chatcmpl-AKxzhNxpVwFrmbcoILCEXEgQwop3G\",\n \"object\": \"chat.completion\",\n \"created\": 1729560541,\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\\\": \\\"OpenAI, legally known as OpenAI, Inc., is an AI research company dedicated to developing safe and beneficial artificial intelligence that aligns with human values and promotes diversity in technology. It operates primarily in the Health Care sector and the Life Sciences Tools & Services industry. Its activities span across various areas including Information Technology & Services, Academic Research, Physical Sciences, Engineering, Life Sciences, and Scientific & Academic Research, with a focus on B2B services.\\\"\\n}\\n```\",\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 265,\n \"completion_tokens\": 103,\n \"total_tokens\": 368,\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/Tools/ClearbitCompanyTool-503bf8fd461d39c783d3b774fa78b28f.json b/tests/Fixtures/Saloon/Tools/ClearbitCompanyTool-503bf8fd461d39c783d3b774fa78b28f.json new file mode 100644 index 0000000..a4c94c7 --- /dev/null +++ b/tests/Fixtures/Saloon/Tools/ClearbitCompanyTool-503bf8fd461d39c783d3b774fa78b28f.json @@ -0,0 +1,31 @@ +{ + "statusCode": 200, + "headers": { + "Date": "Tue, 22 Oct 2024 01:29:01 GMT", + "Content-Type": "application\/json", + "Content-Length": "919", + "Connection": "keep-alive", + "access-control-expose-headers": "X-Request-ID", + "openai-organization": "user-5hvzt3x5aqwr0picqhxifwl8", + "openai-processing-ms": "907", + "openai-version": "2020-10-01", + "x-ratelimit-limit-requests": "10000", + "x-ratelimit-limit-tokens": "2000000", + "x-ratelimit-remaining-requests": "9999", + "x-ratelimit-remaining-tokens": "1999873", + "x-ratelimit-reset-requests": "6ms", + "x-ratelimit-reset-tokens": "3ms", + "x-request-id": "req_f7878283ef6e18fcbf8132cee5a0455a", + "strict-transport-security": "max-age=31536000; includeSubDomains; preload", + "CF-Cache-Status": "DYNAMIC", + "Set-Cookie": [ + "__cf_bm=6PHlwDjNI4H8glQRkd60601.Ugl1R_yvcWt7VR5VnGc-1729560541-1.0.1.1-I3JFrCPq6ai.iZqPLR9_w6QrkeKNJjojD.uHff1lUhqSlXO1YgtP.z7eVBo9XVNPdd1vR3.MnMCssiyz.XA0yw; path=\/; expires=Tue, 22-Oct-24 01:59:01 GMT; domain=.api.openai.com; HttpOnly; Secure; SameSite=None", + "_cfuvid=2GChtEo6KKIVnEn5jTl_4DGZZEcHXVLwkUk23.Xec2w-1729560541014-0.0.1.1-604800000; path=\/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None" + ], + "X-Content-Type-Options": "nosniff", + "Server": "cloudflare", + "CF-RAY": "8d65b6befdf819aa-EWR", + "alt-svc": "h3=\":443\"; ma=86400" + }, + "data": "{\n \"id\": \"chatcmpl-AKxzgDWV6kDn2eoCLTjCIoEfoaPPS\",\n \"object\": \"chat.completion\",\n \"created\": 1729560540,\n \"model\": \"gpt-4-turbo-2024-04-09\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": null,\n \"tool_calls\": [\n {\n \"id\": \"call_qZ3lmgIblORUAfduIGJHeDcS\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"clearbit_company_tool\",\n \"arguments\": \"{\\\"domain\\\":\\\"openai.com\\\"}\"\n }\n }\n ],\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"tool_calls\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 154,\n \"completion_tokens\": 18,\n \"total_tokens\": 172,\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/Tools/CrunchbaseTool-527a61c765676b4729099512e1a42e6a.json b/tests/Fixtures/Saloon/Tools/CrunchbaseTool-527a61c765676b4729099512e1a42e6a.json new file mode 100644 index 0000000..18ca178 --- /dev/null +++ b/tests/Fixtures/Saloon/Tools/CrunchbaseTool-527a61c765676b4729099512e1a42e6a.json @@ -0,0 +1,31 @@ +{ + "statusCode": 200, + "headers": { + "Date": "Tue, 22 Oct 2024 01:29:07 GMT", + "Content-Type": "application\/json", + "Content-Length": "916", + "Connection": "keep-alive", + "access-control-expose-headers": "X-Request-ID", + "openai-organization": "user-5hvzt3x5aqwr0picqhxifwl8", + "openai-processing-ms": "965", + "openai-version": "2020-10-01", + "x-ratelimit-limit-requests": "10000", + "x-ratelimit-limit-tokens": "2000000", + "x-ratelimit-remaining-requests": "9999", + "x-ratelimit-remaining-tokens": "1999871", + "x-ratelimit-reset-requests": "6ms", + "x-ratelimit-reset-tokens": "3ms", + "x-request-id": "req_3de368cb5b6df9fd0bfc65e58977668b", + "strict-transport-security": "max-age=31536000; includeSubDomains; preload", + "CF-Cache-Status": "DYNAMIC", + "Set-Cookie": [ + "__cf_bm=GmnVDsX_tel0VVHmwOjaCuoGzwlIbTebGdZ05HZy.Gw-1729560547-1.0.1.1-HOfG1tkrOD3vsmh8Z9VEYt27ySKLa_WoFELF0bFbZj6JgwRghAtCUalzRXUGjgxWBvB9nnEs3aBazHWVtOEzmQ; path=\/; expires=Tue, 22-Oct-24 01:59:07 GMT; domain=.api.openai.com; HttpOnly; Secure; SameSite=None", + "_cfuvid=pkOCF9gLZOrlgy4TAwnXAkVpp56bOXL4KwHoSnfI58c-1729560547103-0.0.1.1-604800000; path=\/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None" + ], + "X-Content-Type-Options": "nosniff", + "Server": "cloudflare", + "CF-RAY": "8d65b6e4896a72b6-EWR", + "alt-svc": "h3=\":443\"; ma=86400" + }, + "data": "{\n \"id\": \"chatcmpl-AKxzmMFGNIkX3K9QwdAkfLRH93HwA\",\n \"object\": \"chat.completion\",\n \"created\": 1729560546,\n \"model\": \"gpt-4-turbo-2024-04-09\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": null,\n \"tool_calls\": [\n {\n \"id\": \"call_xhzwdqGvs52gZDBu70IQo3iC\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"crunchbase_tool\",\n \"arguments\": \"{\\\"entityId\\\":\\\"siteimprove\\\"}\"\n }\n }\n ],\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"tool_calls\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 150,\n \"completion_tokens\": 19,\n \"total_tokens\": 169,\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/Tools/CrunchbaseTool-91330c935ee3c0271e4611b376117ea7.json b/tests/Fixtures/Saloon/Tools/CrunchbaseTool-91330c935ee3c0271e4611b376117ea7.json new file mode 100644 index 0000000..38ae583 --- /dev/null +++ b/tests/Fixtures/Saloon/Tools/CrunchbaseTool-91330c935ee3c0271e4611b376117ea7.json @@ -0,0 +1,31 @@ +{ + "statusCode": 200, + "headers": { + "Date": "Tue, 22 Oct 2024 01:29:11 GMT", + "Content-Type": "application/json", + "Content-Length": "1127", + "Connection": "keep-alive", + "access-control-expose-headers": "X-Request-ID", + "openai-organization": "user-5hvzt3x5aqwr0picqhxifwl8", + "openai-processing-ms": "3809", + "openai-version": "2020-10-01", + "x-ratelimit-limit-requests": "10000", + "x-ratelimit-limit-tokens": "2000000", + "x-ratelimit-remaining-requests": "9999", + "x-ratelimit-remaining-tokens": "1999230", + "x-ratelimit-reset-requests": "6ms", + "x-ratelimit-reset-tokens": "23ms", + "x-request-id": "req_db34286a7841fcc189d87cf8e4be8d19", + "strict-transport-security": "max-age=31536000; includeSubDomains; preload", + "CF-Cache-Status": "DYNAMIC", + "Set-Cookie": [ + "__cf_bm=o0FpqBcFHHGUkxDANXhS7Xr.gT8kO.heNuPXgBCz6eQ-1729560551-1.0.1.1-.Dwg9rr7MpxbVWO9SznPODRQr9zJn2qHF09HO2ZRf09Zj1PMzxSXC_0dsQbIAJKa1QfkmhtxTD65ShurNIgJAw; path=/; expires=Tue, 22-Oct-24 01:59:11 GMT; domain=.api.openai.com; HttpOnly; Secure; SameSite=None", + "_cfuvid=Uc1vEOnA4NTZFd30WQJN2Qu4BuHhfnqRjwStORjqVe4-1729560551263-0.0.1.1-604800000; path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None" + ], + "X-Content-Type-Options": "nosniff", + "Server": "cloudflare", + "CF-RAY": "8d65b6ecce0a8ce6-EWR", + "alt-svc": "h3=\":443\"; ma=86400" + }, + "data": "{\n \"id\": \"chatcmpl-AKxznJ52joKwF2QqtalZLLGjV5936\",\n \"object\": \"chat.completion\",\n \"created\": 1729560547,\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\\\": \\\"Siteimprove offers comprehensive cloud-based digital presence optimization software. Located in Copenhagen, Denmark, the company also has locations in Hovedstaden and is prominent within Europe. Siteimprove has an active presence on LinkedIn, Facebook, and Twitter. More details about the company can be found on their website at http://siteimprove.com. The company was created on June 21, 2014, and the latest update on their profile was on September 3, 2024.\\\"\\n}\\n```\",\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 898,\n \"completion_tokens\": 110,\n \"total_tokens\": 1008,\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/Tools/FirecrawlTool-43bcd63cc9d9b98eb8488d0e1a4c4174.json b/tests/Fixtures/Saloon/Tools/FirecrawlTool-43bcd63cc9d9b98eb8488d0e1a4c4174.json new file mode 100644 index 0000000..41ff66b --- /dev/null +++ b/tests/Fixtures/Saloon/Tools/FirecrawlTool-43bcd63cc9d9b98eb8488d0e1a4c4174.json @@ -0,0 +1,31 @@ +{ + "statusCode": 200, + "headers": { + "Date": "Tue, 22 Oct 2024 01:29:15 GMT", + "Content-Type": "application\/json", + "Content-Length": "1001", + "Connection": "keep-alive", + "access-control-expose-headers": "X-Request-ID", + "openai-organization": "user-5hvzt3x5aqwr0picqhxifwl8", + "openai-processing-ms": "1423", + "openai-version": "2020-10-01", + "x-ratelimit-limit-requests": "10000", + "x-ratelimit-limit-tokens": "2000000", + "x-ratelimit-remaining-requests": "9999", + "x-ratelimit-remaining-tokens": "1999868", + "x-ratelimit-reset-requests": "6ms", + "x-ratelimit-reset-tokens": "3ms", + "x-request-id": "req_83947e3fedb8e55c0cecd4763dc7106a", + "strict-transport-security": "max-age=31536000; includeSubDomains; preload", + "CF-Cache-Status": "DYNAMIC", + "Set-Cookie": [ + "__cf_bm=kl0HCYhDWdQBHgu.au70qqhChKk5RaAT1LEbZ7.6R18-1729560555-1.0.1.1-QcPuKMjTG83kHEndnvp.zEX6Q9wx94nCOc_NpD56yCySJKLKQ._VUZyb7N9NQW6MVPNcwO32Qxwp_YrIcZYu2A; path=\/; expires=Tue, 22-Oct-24 01:59:15 GMT; domain=.api.openai.com; HttpOnly; Secure; SameSite=None", + "_cfuvid=.MwFI73GnUCEax2U8GwoTYEDfqLLG6ccDc.TIosZQrY-1729560555299-0.0.1.1-604800000; path=\/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None" + ], + "X-Content-Type-Options": "nosniff", + "Server": "cloudflare", + "CF-RAY": "8d65b714de574252-EWR", + "alt-svc": "h3=\":443\"; ma=86400" + }, + "data": "{\n \"id\": \"chatcmpl-AKxzt9uuS0RxiTGLtYoHR26gRNPjy\",\n \"object\": \"chat.completion\",\n \"created\": 1729560553,\n \"model\": \"gpt-4-turbo-2024-04-09\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": null,\n \"tool_calls\": [\n {\n \"id\": \"call_N1tuNKzGU3rp68ipitruNElF\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"firecrawl_tool\",\n \"arguments\": \"{\\\"url\\\":\\\"https:\/\/www.firecrawl.dev\/\\\",\\\"extractionPrompt\\\":\\\"Describe the main purpose or focus of the website.\\\"}\"\n }\n }\n ],\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"tool_calls\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 176,\n \"completion_tokens\": 36,\n \"total_tokens\": 212,\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/Tools/FirecrawlTool-ab05a60a52727034e24aa4e6cf67e965.json b/tests/Fixtures/Saloon/Tools/FirecrawlTool-ab05a60a52727034e24aa4e6cf67e965.json new file mode 100644 index 0000000..9e6c062 --- /dev/null +++ b/tests/Fixtures/Saloon/Tools/FirecrawlTool-ab05a60a52727034e24aa4e6cf67e965.json @@ -0,0 +1,31 @@ +{ + "statusCode": 200, + "headers": { + "Date": "Tue, 22 Oct 2024 01:29:19 GMT", + "Content-Type": "application/json", + "Content-Length": "1243", + "Connection": "keep-alive", + "access-control-expose-headers": "X-Request-ID", + "openai-organization": "user-5hvzt3x5aqwr0picqhxifwl8", + "openai-processing-ms": "3743", + "openai-version": "2020-10-01", + "x-ratelimit-limit-requests": "10000", + "x-ratelimit-limit-tokens": "2000000", + "x-ratelimit-remaining-requests": "9999", + "x-ratelimit-remaining-tokens": "1999501", + "x-ratelimit-reset-requests": "6ms", + "x-ratelimit-reset-tokens": "14ms", + "x-request-id": "req_6c49e6f9afc19e947109dfc9ef9ce202", + "strict-transport-security": "max-age=31536000; includeSubDomains; preload", + "CF-Cache-Status": "DYNAMIC", + "Set-Cookie": [ + "__cf_bm=nOMULEv5yuI9xFkS7CdqwA5I2RT1MMrui697RxR7lWY-1729560559-1.0.1.1-NXx07yOPtkm_wBncy6piWMBpcgvkwy91py7vKafSkCI_q1_gUkDtFCM43IPnJRPsPmZqGnbt0zUW3mTjLMw_tQ; path=/; expires=Tue, 22-Oct-24 01:59:19 GMT; domain=.api.openai.com; HttpOnly; Secure; SameSite=None", + "_cfuvid=nB4vf77ERmsCEGV.YXAeeJg8hzi4jzIRjmwLmxIeJt4-1729560559792-0.0.1.1-604800000; path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None" + ], + "X-Content-Type-Options": "nosniff", + "Server": "cloudflare", + "CF-RAY": "8d65b722892b1982-EWR", + "alt-svc": "h3=\":443\"; ma=86400" + }, + "data": "{\n \"id\": \"chatcmpl-AKxzwFiarb6UIp1MHNP6ix6pjESmk\",\n \"object\": \"chat.completion\",\n \"created\": 1729560556,\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\\\": \\\"The website 'https://www.firecrawl.dev/' is about Firecrawl, a web scraping tool designed for extracting, cleaning, and converting web data into formats suitable for AI applications, particularly Large Language Models (LLMs). It offers features like crawling web subpages without needing a sitemap, handling JavaScript-rendered content, and providing clean markdown or structured data for AI training. The target audience includes LLM engineers, data scientists, and AI researchers. Firecrawl is open-source and offers various pricing plans to accommodate different user needs.\\\"\\n}\\n```\",\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 497,\n \"completion_tokens\": 118,\n \"total_tokens\": 615,\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/Tools/SQLTestAgent-3e0f0fd702de589714e68a3b90a2ac15.json b/tests/Fixtures/Saloon/Tools/SQLTestAgent-3e0f0fd702de589714e68a3b90a2ac15.json new file mode 100644 index 0000000..1c09674 --- /dev/null +++ b/tests/Fixtures/Saloon/Tools/SQLTestAgent-3e0f0fd702de589714e68a3b90a2ac15.json @@ -0,0 +1,31 @@ +{ + "statusCode": 200, + "headers": { + "Date": "Tue, 22 Oct 2024 01:29:23 GMT", + "Content-Type": "application\/json", + "Content-Length": "1044", + "Connection": "keep-alive", + "access-control-expose-headers": "X-Request-ID", + "openai-organization": "user-5hvzt3x5aqwr0picqhxifwl8", + "openai-processing-ms": "1526", + "openai-version": "2020-10-01", + "x-ratelimit-limit-requests": "10000", + "x-ratelimit-limit-tokens": "2000000", + "x-ratelimit-remaining-requests": "9999", + "x-ratelimit-remaining-tokens": "1999814", + "x-ratelimit-reset-requests": "6ms", + "x-ratelimit-reset-tokens": "5ms", + "x-request-id": "req_2059b123e21a9db863f680b770278918", + "strict-transport-security": "max-age=31536000; includeSubDomains; preload", + "CF-Cache-Status": "DYNAMIC", + "Set-Cookie": [ + "__cf_bm=guVqR.qKuJyrWAcltjsK8jsZ16EItRlFsXa.ROQ3oUg-1729560563-1.0.1.1-q_oavJ0x_uuIj1MxntLxATA1dU3Dkzg7HzLm2Ndg4vOTnNyfPv1V8ZwEmF1mBPLDibmeuQAYLdbiXEN2M16FXQ; path=\/; expires=Tue, 22-Oct-24 01:59:23 GMT; domain=.api.openai.com; HttpOnly; Secure; SameSite=None", + "_cfuvid=xYJXGfv7beSxp_v.6fPQ4UGWnSZ86A3455lGlRorIw0-1729560563398-0.0.1.1-604800000; path=\/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None" + ], + "X-Content-Type-Options": "nosniff", + "Server": "cloudflare", + "CF-RAY": "8d65b746f90d0ce1-EWR", + "alt-svc": "h3=\":443\"; ma=86400" + }, + "data": "{\n \"id\": \"chatcmpl-AKy01tp4VAvOrPo24egK0NiQxcao6\",\n \"object\": \"chat.completion\",\n \"created\": 1729560561,\n \"model\": \"gpt-4-turbo-2024-04-09\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": null,\n \"tool_calls\": [\n {\n \"id\": \"call_TTyOgEachMKRBCv1QZhbOeaj\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"query_s_q_l_data_base_tool\",\n \"arguments\": \"{\\\"query\\\":\\\"SELECT COUNT(*) AS total_organizations, AVG(funding_rounds) AS average_funding_rounds FROM organizations WHERE status = 'operating'\\\"}\"\n }\n }\n ],\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"tool_calls\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 345,\n \"completion_tokens\": 47,\n \"total_tokens\": 392,\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/Tools/SQLTestAgent-69088b2ddcf517d967507def8d0bc9e9.json b/tests/Fixtures/Saloon/Tools/SQLTestAgent-69088b2ddcf517d967507def8d0bc9e9.json new file mode 100644 index 0000000..b584899 --- /dev/null +++ b/tests/Fixtures/Saloon/Tools/SQLTestAgent-69088b2ddcf517d967507def8d0bc9e9.json @@ -0,0 +1,31 @@ +{ + "statusCode": 200, + "headers": { + "Date": "Tue, 22 Oct 2024 01:29:29 GMT", + "Content-Type": "application\/json", + "Content-Length": "757", + "Connection": "keep-alive", + "access-control-expose-headers": "X-Request-ID", + "openai-organization": "user-5hvzt3x5aqwr0picqhxifwl8", + "openai-processing-ms": "1176", + "openai-version": "2020-10-01", + "x-ratelimit-limit-requests": "10000", + "x-ratelimit-limit-tokens": "2000000", + "x-ratelimit-remaining-requests": "9999", + "x-ratelimit-remaining-tokens": "1999094", + "x-ratelimit-reset-requests": "6ms", + "x-ratelimit-reset-tokens": "27ms", + "x-request-id": "req_37a09ee5507aa155d015a29878bb4078", + "strict-transport-security": "max-age=31536000; includeSubDomains; preload", + "CF-Cache-Status": "DYNAMIC", + "Set-Cookie": [ + "__cf_bm=A9yzFLnE6kVi6.wlRB9qaJ1V41Qi1YGJ4SoCXQH6HNo-1729560569-1.0.1.1-YvvQydpUUtNfxrFAgbAu1DUjbuRuAkFOfkAyjIw1aWfv0Q0u6PtAN_tmYm5npzzDdEdqw97d1OHKTa_sZDn3jg; path=\/; expires=Tue, 22-Oct-24 01:59:29 GMT; domain=.api.openai.com; HttpOnly; Secure; SameSite=None", + "_cfuvid=Y83CCP2u_w9zGbMZ3ZZ6LiAbyxzaEMMhrzE6R2VLEgQ-1729560569590-0.0.1.1-604800000; path=\/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None" + ], + "X-Content-Type-Options": "nosniff", + "Server": "cloudflare", + "CF-RAY": "8d65b76fcec017e9-EWR", + "alt-svc": "h3=\":443\"; ma=86400" + }, + "data": "{\n \"id\": \"chatcmpl-AKy08fPRRCPOJll5zCiC9Tf9RgIvy\",\n \"object\": \"chat.completion\",\n \"created\": 1729560568,\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\\\": \\\"There are 100 organizations currently operating, with an average of 5 funding rounds each.\\\"\\n}\\n```\",\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 1257,\n \"completion_tokens\": 30,\n \"total_tokens\": 1287,\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/Tools/SQLTestAgent-abf1d4c9a9f535c0fbcb9eff86e94f08.json b/tests/Fixtures/Saloon/Tools/SQLTestAgent-abf1d4c9a9f535c0fbcb9eff86e94f08.json new file mode 100644 index 0000000..d6fd204 --- /dev/null +++ b/tests/Fixtures/Saloon/Tools/SQLTestAgent-abf1d4c9a9f535c0fbcb9eff86e94f08.json @@ -0,0 +1,31 @@ +{ + "statusCode": 200, + "headers": { + "Date": "Tue, 22 Oct 2024 01:29:21 GMT", + "Content-Type": "application/json", + "Content-Length": "897", + "Connection": "keep-alive", + "access-control-expose-headers": "X-Request-ID", + "openai-organization": "user-5hvzt3x5aqwr0picqhxifwl8", + "openai-processing-ms": "632", + "openai-version": "2020-10-01", + "x-ratelimit-limit-requests": "10000", + "x-ratelimit-limit-tokens": "2000000", + "x-ratelimit-remaining-requests": "9999", + "x-ratelimit-remaining-tokens": "1999856", + "x-ratelimit-reset-requests": "6ms", + "x-ratelimit-reset-tokens": "4ms", + "x-request-id": "req_56d8781ddcde5a717472de7255a7991f", + "strict-transport-security": "max-age=31536000; includeSubDomains; preload", + "CF-Cache-Status": "DYNAMIC", + "Set-Cookie": [ + "__cf_bm=yScYbZHL_Rd7LMBdTpqIYLccKSzl1rlP5zEzZgjGq3Y-1729560561-1.0.1.1-ZFJrMkEq2vNiXa5YjLYUMEEAmr72W7Gj2ujOu4699wkYYbI5scdPcP0grtI10lvMPQJWdM5FxH.0YyFeWrAtew; path=/; expires=Tue, 22-Oct-24 01:59:21 GMT; domain=.api.openai.com; HttpOnly; Secure; SameSite=None", + "_cfuvid=yDuONGmF_ychELOKioHUiji5lE8KMuWVkYMzCG979FM-1729560561339-0.0.1.1-604800000; path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None" + ], + "X-Content-Type-Options": "nosniff", + "Server": "cloudflare", + "CF-RAY": "8d65b73f89834326-EWR", + "alt-svc": "h3=\":443\"; ma=86400" + }, + "data": "{\n \"id\": \"chatcmpl-AKy001GD1R3IFY492fC5V4tIRqf04\",\n \"object\": \"chat.completion\",\n \"created\": 1729560560,\n \"model\": \"gpt-4-turbo-2024-04-09\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": null,\n \"tool_calls\": [\n {\n \"id\": \"call_fOZCSDVshke9wStxQAoXXOE2\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"list_s_q_l_database_tool\",\n \"arguments\": \"{}\"\n }\n }\n ],\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"tool_calls\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 284,\n \"completion_tokens\": 14,\n \"total_tokens\": 298,\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/Tools/SQLTestAgent-e3b7bce01bc7df21e79bf8c5c7fbf744.json b/tests/Fixtures/Saloon/Tools/SQLTestAgent-e3b7bce01bc7df21e79bf8c5c7fbf744.json new file mode 100644 index 0000000..af5e86a --- /dev/null +++ b/tests/Fixtures/Saloon/Tools/SQLTestAgent-e3b7bce01bc7df21e79bf8c5c7fbf744.json @@ -0,0 +1,31 @@ +{ + "statusCode": 200, + "headers": { + "Date": "Tue, 22 Oct 2024 01:29:28 GMT", + "Content-Type": "application/json", + "Content-Length": "1050", + "Connection": "keep-alive", + "access-control-expose-headers": "X-Request-ID", + "openai-organization": "user-5hvzt3x5aqwr0picqhxifwl8", + "openai-processing-ms": "2142", + "openai-version": "2020-10-01", + "x-ratelimit-limit-requests": "10000", + "x-ratelimit-limit-tokens": "2000000", + "x-ratelimit-remaining-requests": "9999", + "x-ratelimit-remaining-tokens": "1999110", + "x-ratelimit-reset-requests": "6ms", + "x-ratelimit-reset-tokens": "26ms", + "x-request-id": "req_50e972e2d459ebad8d8b2efc671b393d", + "strict-transport-security": "max-age=31536000; includeSubDomains; preload", + "CF-Cache-Status": "DYNAMIC", + "Set-Cookie": [ + "__cf_bm=09n047pzK1ARvDHZPk2f0N5N_VdzPp0t7ZvFNdA1.mo-1729560568-1.0.1.1-ZNsGq9Vnotn9x1yolzrlh4y1tEpKaNzhtfv9Oq_p5_gBcm_AXnlYCF.3Yak2kBu_upwxALCausj4oCiw7fjZKQ; path=/; expires=Tue, 22-Oct-24 01:59:28 GMT; domain=.api.openai.com; HttpOnly; Secure; SameSite=None", + "_cfuvid=dAOMJBz_uESCqPJqSTnOfjZDmF8LDId7aGFeu4CLfWI-1729560568037-0.0.1.1-604800000; path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None" + ], + "X-Content-Type-Options": "nosniff", + "Server": "cloudflare", + "CF-RAY": "8d65b7601da68cc8-EWR", + "alt-svc": "h3=\":443\"; ma=86400" + }, + "data": "{\n \"id\": \"chatcmpl-AKy053cRiePzZPxxhOhoBpyz1t7R4\",\n \"object\": \"chat.completion\",\n \"created\": 1729560565,\n \"model\": \"gpt-4-turbo-2024-04-09\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": null,\n \"tool_calls\": [\n {\n \"id\": \"call_Yx8Chp7MvDVisrQT9QKYL1na\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"query_s_q_l_data_base_tool\",\n \"arguments\": \"{\\\"query\\\":\\\"SELECT COUNT(*) AS total_organizations, AVG(num_funding_rounds) AS average_funding_rounds FROM organizations WHERE status = 'operating'\\\"}\"\n }\n }\n ],\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"tool_calls\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 1180,\n \"completion_tokens\": 48,\n \"total_tokens\": 1228,\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/Tools/SQLTestAgent-e8159268c7e07a723f5966bd56d71812.json b/tests/Fixtures/Saloon/Tools/SQLTestAgent-e8159268c7e07a723f5966bd56d71812.json new file mode 100644 index 0000000..3669707 --- /dev/null +++ b/tests/Fixtures/Saloon/Tools/SQLTestAgent-e8159268c7e07a723f5966bd56d71812.json @@ -0,0 +1,31 @@ +{ + "statusCode": 200, + "headers": { + "Date": "Tue, 22 Oct 2024 01:29:25 GMT", + "Content-Type": "application\/json", + "Content-Length": "925", + "Connection": "keep-alive", + "access-control-expose-headers": "X-Request-ID", + "openai-organization": "user-5hvzt3x5aqwr0picqhxifwl8", + "openai-processing-ms": "1688", + "openai-version": "2020-10-01", + "x-ratelimit-limit-requests": "10000", + "x-ratelimit-limit-tokens": "2000000", + "x-ratelimit-remaining-requests": "9999", + "x-ratelimit-remaining-tokens": "1999756", + "x-ratelimit-reset-requests": "6ms", + "x-ratelimit-reset-tokens": "7ms", + "x-request-id": "req_1d896cac3b2f36a11d63050f0744a671", + "strict-transport-security": "max-age=31536000; includeSubDomains; preload", + "CF-Cache-Status": "DYNAMIC", + "Set-Cookie": [ + "__cf_bm=kjd46MXC4gZrZJbsCCK3en9OCtrGlZMIV3P7UO7fLWk-1729560565-1.0.1.1-sB5B.Ax3jmsAzGtlT_ZYH27YHwwnL96egOpsOQ2wc8SaGD2cmW.OGSEpUop_jNshPIl5oR_iWRI9al66DrukrQ; path=\/; expires=Tue, 22-Oct-24 01:59:25 GMT; domain=.api.openai.com; HttpOnly; Secure; SameSite=None", + "_cfuvid=fXHmS2G3edYEejtHbzQySiss4wDMDKvYOgfnUiaXn6Q-1729560565521-0.0.1.1-604800000; path=\/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None" + ], + "X-Content-Type-Options": "nosniff", + "Server": "cloudflare", + "CF-RAY": "8d65b7533d0272c2-EWR", + "alt-svc": "h3=\":443\"; ma=86400" + }, + "data": "{\n \"id\": \"chatcmpl-AKy03kK87akDyLYbbJuDqrhHSx0R4\",\n \"object\": \"chat.completion\",\n \"created\": 1729560563,\n \"model\": \"gpt-4-turbo-2024-04-09\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": null,\n \"tool_calls\": [\n {\n \"id\": \"call_5Hxryd7lM0K79EMz6cTdEKC9\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"info_s_q_l_database_tool\",\n \"arguments\": \"{\\\"tables\\\":\\\"organizations\\\"}\"\n }\n }\n ],\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"tool_calls\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 459,\n \"completion_tokens\": 18,\n \"total_tokens\": 477,\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/Tools/SerpAPIGoogleNewsTool-3ca51b450f65fd56079ce1db68405384.json b/tests/Fixtures/Saloon/Tools/SerpAPIGoogleNewsTool-3ca51b450f65fd56079ce1db68405384.json new file mode 100644 index 0000000..81c1c9e --- /dev/null +++ b/tests/Fixtures/Saloon/Tools/SerpAPIGoogleNewsTool-3ca51b450f65fd56079ce1db68405384.json @@ -0,0 +1,31 @@ +{ + "statusCode": 200, + "headers": { + "Date": "Tue, 22 Oct 2024 01:29:47 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": "15503", + "openai-version": "2020-10-01", + "x-ratelimit-limit-requests": "10000", + "x-ratelimit-limit-tokens": "2000000", + "x-ratelimit-remaining-requests": "9999", + "x-ratelimit-remaining-tokens": "1993944", + "x-ratelimit-reset-requests": "6ms", + "x-ratelimit-reset-tokens": "181ms", + "x-request-id": "req_b28823223838ac9fe8e69d5305c1b36a", + "strict-transport-security": "max-age=31536000; includeSubDomains; preload", + "CF-Cache-Status": "DYNAMIC", + "Set-Cookie": [ + "__cf_bm=aCCfAOS5xf0lUlwFIpj6oIBEMZ7u5UklTIjGKX4VWLc-1729560587-1.0.1.1-WXF.mGTeHhf3ncnnaWPM9RAVkcEUMBNQZ0KY238Dy1COFW3AKLs0Rs8OGWh5PlZEI0EHGfN1anPU66RyyI9ULg; path=/; expires=Tue, 22-Oct-24 01:59:47 GMT; domain=.api.openai.com; HttpOnly; Secure; SameSite=None", + "_cfuvid=I7wUOmNBlQg7QrAzXx24GwbiCEBKJtdobXTPllfKYPg-1729560587513-0.0.1.1-604800000; path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None" + ], + "X-Content-Type-Options": "nosniff", + "Server": "cloudflare", + "CF-RAY": "8d65b7860d318c54-EWR", + "alt-svc": "h3=\":443\"; ma=86400" + }, + "data": "{\n \"id\": \"chatcmpl-AKy0CIR6qrXS1HLjvd7OsRNZlio4S\",\n \"object\": \"chat.completion\",\n \"created\": 1729560572,\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\\\": [\\n {\\n \\\"title\\\": \\\"Apple MacBook Air M4: news, rumors, and everything we know\\\",\\n \\\"date\\\": \\\"10/04/2024\\\",\\n \\\"link\\\": \\\"https://www.techradar.com/computing/macbooks/macbook-air-m4\\\"\\n },\\n {\\n \\\"title\\\": \\\"Apple Intelligence to boost iPhone 16 series sales: Analysts\\\",\\n \\\"date\\\": \\\"10/04/2024\\\",\\n \\\"link\\\": \\\"https://www.androidheadlines.com/2024/10/apple-intelligence-to-boost-iphone-16-series-sales-analysts.html\\\"\\n },\\n {\\n \\\"title\\\": \\\"Thursday\u2019s Headlines: Apples and Honey and Game 3 Edition\\\",\\n \\\"date\\\": \\\"10/03/2024\\\",\\n \\\"link\\\": \\\"https://nyc.streetsblog.org/2024/10/03/thursdays-headlines-apples-and-honey-and-game-3-edition\\\"\\n },\\n {\\n \\\"title\\\": \\\"NYC buses tout Big Flavor in The Big Apple\\\",\\n \\\"date\\\": \\\"10/03/2024\\\",\\n \\\"link\\\": \\\"https://theproducenews.com/headlines/nyc-buses-tout-big-flavor-big-apple\\\"\\n },\\n {\\n \\\"title\\\": \\\"First iOS 18 and iPadOS 18 patches fix serious bugs\\\",\\n \\\"date\\\": \\\"10/03/2024\\\",\\n \\\"link\\\": \\\"https://www.cultofmac.com/news/ios-18-0-1-ipados-macos-sequoia-15-0-1-patches-fix-serious-bugs\\\"\\n },\\n {\\n \\\"title\\\": \\\"'Tastes are changing so rapidly': Biting into the Western New York apple market\\\",\\n \\\"date\\\": \\\"10/01/2024\\\",\\n \\\"link\\\": \\\"https://www.wkbw.com/news/local-news/niagara-orleans/tastes-are-changing-rapidly-biting-into-the-wny-apple-market\\\"\\n },\\n {\\n \\\"title\\\": \\\"These five Apple products will likely be discontinued next month\\\",\\n \\\"date\\\": \\\"09/28/2024\\\",\\n \\\"link\\\": \\\"https://9to5mac.com/2024/09/28/apple-discontinuing-products-october/\\\"\\n },\\n {\\n \\\"title\\\": \\\"Apple possibly cuts Q4 iPhone 16 builds by 3M: Barclays\\\",\\n \\\"date\\\": \\\"10/01/2024\\\",\\n \\\"link\\\": \\\"https://seekingalpha.com/news/4154936-apple-possibly-cuts-q4-iphone-16-builds-by-3m-barclays\\\"\\n }\\n ]\\n}\\n```\",\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 8015,\n \"completion_tokens\": 567,\n \"total_tokens\": 8582,\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/Tools/SerpAPIGoogleNewsTool-8b5a265c43dea6f4ed40a3d21bd13bf1.json b/tests/Fixtures/Saloon/Tools/SerpAPIGoogleNewsTool-8b5a265c43dea6f4ed40a3d21bd13bf1.json new file mode 100644 index 0000000..819f2c6 --- /dev/null +++ b/tests/Fixtures/Saloon/Tools/SerpAPIGoogleNewsTool-8b5a265c43dea6f4ed40a3d21bd13bf1.json @@ -0,0 +1,31 @@ +{ + "statusCode": 200, + "headers": { + "Date": "Tue, 22 Oct 2024 01:29:31 GMT", + "Content-Type": "application\/json", + "Content-Length": "929", + "Connection": "keep-alive", + "access-control-expose-headers": "X-Request-ID", + "openai-organization": "user-5hvzt3x5aqwr0picqhxifwl8", + "openai-processing-ms": "1293", + "openai-version": "2020-10-01", + "x-ratelimit-limit-requests": "10000", + "x-ratelimit-limit-tokens": "2000000", + "x-ratelimit-remaining-requests": "9999", + "x-ratelimit-remaining-tokens": "1999869", + "x-ratelimit-reset-requests": "6ms", + "x-ratelimit-reset-tokens": "3ms", + "x-request-id": "req_8923e9fd27fdf4c71c793871bb1e7728", + "strict-transport-security": "max-age=31536000; includeSubDomains; preload", + "CF-Cache-Status": "DYNAMIC", + "Set-Cookie": [ + "__cf_bm=kpMEZlG9LXuUY7.KeKSdeRYEXv8A3zzF52Yawk0n9iY-1729560571-1.0.1.1-RpHwS3B6cX2zMPV6RXNAlm5SNYR6770etyc007R12TzIiVXrbvBqWOESUig3FoKxKHnWBPAVMv1sKrQtWfXUIA; path=\/; expires=Tue, 22-Oct-24 01:59:31 GMT; domain=.api.openai.com; HttpOnly; Secure; SameSite=None", + "_cfuvid=irhipbpfUKI6EJeYDSNkQG1M3ohGDv6GaASL3TO5pME-1729560571556-0.0.1.1-604800000; path=\/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None" + ], + "X-Content-Type-Options": "nosniff", + "Server": "cloudflare", + "CF-RAY": "8d65b77b6e5b43dc-EWR", + "alt-svc": "h3=\":443\"; ma=86400" + }, + "data": "{\n \"id\": \"chatcmpl-AKy0APamYmgS1VTadZJi7C5FrEqqP\",\n \"object\": \"chat.completion\",\n \"created\": 1729560570,\n \"model\": \"gpt-4-turbo-2024-04-09\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": null,\n \"tool_calls\": [\n {\n \"id\": \"call_V5KWoIiGuHXsVshlA3A7dNa7\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"serp_a_p_i_google_news_tool\",\n \"arguments\": \"{\\\"query\\\":\\\"Apple headlines\\\"}\"\n }\n }\n ],\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"tool_calls\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 154,\n \"completion_tokens\": 21,\n \"total_tokens\": 175,\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/Tools/SerpAPIGoogleNewsTool-cfec9d7d5277386c7e0255e1ca7e2d1e.json b/tests/Fixtures/Saloon/Tools/SerpAPIGoogleNewsTool-cfec9d7d5277386c7e0255e1ca7e2d1e.json new file mode 100644 index 0000000..60b4e02 --- /dev/null +++ b/tests/Fixtures/Saloon/Tools/SerpAPIGoogleNewsTool-cfec9d7d5277386c7e0255e1ca7e2d1e.json @@ -0,0 +1,31 @@ +{ + "statusCode": 200, + "headers": { + "Date": "Tue, 22 Oct 2024 01:29:51 GMT", + "Content-Type": "application/json", + "Content-Length": "984", + "Connection": "keep-alive", + "access-control-expose-headers": "X-Request-ID", + "openai-organization": "user-5hvzt3x5aqwr0picqhxifwl8", + "openai-processing-ms": "3500", + "openai-version": "2020-10-01", + "x-ratelimit-limit-requests": "10000", + "x-ratelimit-limit-tokens": "2000000", + "x-ratelimit-remaining-requests": "9999", + "x-ratelimit-remaining-tokens": "1993311", + "x-ratelimit-reset-requests": "6ms", + "x-ratelimit-reset-tokens": "200ms", + "x-request-id": "req_3a530427f3fb5275abad4a947b50a520", + "strict-transport-security": "max-age=31536000; includeSubDomains; preload", + "CF-Cache-Status": "DYNAMIC", + "Set-Cookie": [ + "__cf_bm=P5A2Tt3SPQe09fylK18LXp_X18CSdW2W_K9CyW6az7k-1729560591-1.0.1.1-Tb0GsT0L08GV4n093qOD7l3f5XT4KeQX7Pg0.rH3yixQHdHyDCd_B91FEMVhUwiwOhMV20IVGOCBzIav9zdpfA; path=/; expires=Tue, 22-Oct-24 01:59:51 GMT; domain=.api.openai.com; HttpOnly; Secure; SameSite=None", + "_cfuvid=DrMJZMwqUov3e.Pph5RNGJuNyG3rxjlgJH7QhN3U51Y-1729560591407-0.0.1.1-604800000; path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None" + ], + "X-Content-Type-Options": "nosniff", + "Server": "cloudflare", + "CF-RAY": "8d65b7e95b5842c7-EWR", + "alt-svc": "h3=\":443\"; ma=86400" + }, + "data": "{\n \"id\": \"chatcmpl-AKy0SUHFvtoKtSXDzBPscbArm1BU6\",\n \"object\": \"chat.completion\",\n \"created\": 1729560588,\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\\\": \\\"Current headlines about Apple include news about potential discontinuation of some products, sales predictions for the iPhone 16 series based on Apple Intelligence, and technical updates like iOS 18 patches. There is also speculation about an Apple event titled 'Glowtime' which could feature iPhone 16 announcements.\\\"\\n}\\n```\",\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 8688,\n \"completion_tokens\": 70,\n \"total_tokens\": 8758,\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/Tools/SerpAPIGoogleSearchTool-8c4de06e2a7064e26c30dd1131e7c149.json b/tests/Fixtures/Saloon/Tools/SerpAPIGoogleSearchTool-8c4de06e2a7064e26c30dd1131e7c149.json new file mode 100644 index 0000000..f288fa6 --- /dev/null +++ b/tests/Fixtures/Saloon/Tools/SerpAPIGoogleSearchTool-8c4de06e2a7064e26c30dd1131e7c149.json @@ -0,0 +1,31 @@ +{ + "statusCode": 200, + "headers": { + "Date": "Tue, 22 Oct 2024 01:29:53 GMT", + "Content-Type": "application\/json", + "Content-Length": "954", + "Connection": "keep-alive", + "access-control-expose-headers": "X-Request-ID", + "openai-organization": "user-5hvzt3x5aqwr0picqhxifwl8", + "openai-processing-ms": "1247", + "openai-version": "2020-10-01", + "x-ratelimit-limit-requests": "10000", + "x-ratelimit-limit-tokens": "2000000", + "x-ratelimit-remaining-requests": "9999", + "x-ratelimit-remaining-tokens": "1999865", + "x-ratelimit-reset-requests": "6ms", + "x-ratelimit-reset-tokens": "4ms", + "x-request-id": "req_70eaa38447b73c31413c67d7bbf1f47d", + "strict-transport-security": "max-age=31536000; includeSubDomains; preload", + "CF-Cache-Status": "DYNAMIC", + "Set-Cookie": [ + "__cf_bm=7eHWmAyfGzR6juUCfyuBeN99c8KHPXfHWfyUvZuhKtI-1729560593-1.0.1.1-7ofygxNEZ0A2b0fgEQi0NLEWP5Lrr0ZmG1deBuyWXVMk_T0P8LrFJ_IKxo_aVGoqYSKHJSmHEg_t3r2mhXiBzQ; path=\/; expires=Tue, 22-Oct-24 01:59:53 GMT; domain=.api.openai.com; HttpOnly; Secure; SameSite=None", + "_cfuvid=9sZGvKFjmix0xrHzhPzBokXwrBJObGreU7eHjSjLYkw-1729560593486-0.0.1.1-604800000; path=\/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None" + ], + "X-Content-Type-Options": "nosniff", + "Server": "cloudflare", + "CF-RAY": "8d65b8049d5e4263-EWR", + "alt-svc": "h3=\":443\"; ma=86400" + }, + "data": "{\n \"id\": \"chatcmpl-AKy0WZlI3LQD1CiU5jqMS42NdRl5K\",\n \"object\": \"chat.completion\",\n \"created\": 1729560592,\n \"model\": \"gpt-4-turbo-2024-04-09\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": null,\n \"tool_calls\": [\n {\n \"id\": \"call_D1ZxYXnRzUQYd8s2Ax6NyYRY\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"serp_a_p_i_google_search_tool\",\n \"arguments\": \"{\\\"query\\\":\\\"current president of the United States\\\"}\"\n }\n }\n ],\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"tool_calls\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 201,\n \"completion_tokens\": 25,\n \"total_tokens\": 226,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0\n }\n },\n \"system_fingerprint\": \"fp_ba97e70e7c\"\n}\n" +} \ No newline at end of file diff --git a/tests/Fixtures/Saloon/Tools/SerpAPIGoogleSearchTool-aabcdc9cde285aa6d7d0dd01b03c7b1c.json b/tests/Fixtures/Saloon/Tools/SerpAPIGoogleSearchTool-aabcdc9cde285aa6d7d0dd01b03c7b1c.json new file mode 100644 index 0000000..6c306bc --- /dev/null +++ b/tests/Fixtures/Saloon/Tools/SerpAPIGoogleSearchTool-aabcdc9cde285aa6d7d0dd01b03c7b1c.json @@ -0,0 +1,31 @@ +{ + "statusCode": 200, + "headers": { + "Date": "Tue, 22 Oct 2024 01:29:54 GMT", + "Content-Type": "application\/json", + "Content-Length": "676", + "Connection": "keep-alive", + "access-control-expose-headers": "X-Request-ID", + "openai-organization": "user-5hvzt3x5aqwr0picqhxifwl8", + "openai-processing-ms": "1058", + "openai-version": "2020-10-01", + "x-ratelimit-limit-requests": "10000", + "x-ratelimit-limit-tokens": "2000000", + "x-ratelimit-remaining-requests": "9999", + "x-ratelimit-remaining-tokens": "1999050", + "x-ratelimit-reset-requests": "6ms", + "x-ratelimit-reset-tokens": "28ms", + "x-request-id": "req_3b949168b3ca9daf7d5be223bbca1ed3", + "strict-transport-security": "max-age=31536000; includeSubDomains; preload", + "CF-Cache-Status": "DYNAMIC", + "Set-Cookie": [ + "__cf_bm=pjfhIhJbAaIG04755EbB7LYEG.zHp1ks5afhD0.f74c-1729560594-1.0.1.1-bmGL3vVBgNNovCC66JF0RsHbPpgKHqWVYWyGHk1EfVE1vLnsEkHdbQyS1R_DZchiR2UYvhTBP865k3ovMjJjlg; path=\/; expires=Tue, 22-Oct-24 01:59:54 GMT; domain=.api.openai.com; HttpOnly; Secure; SameSite=None", + "_cfuvid=xu0leeGwltYjfV9AQ3O7JAmRR1mxyAgSkFbbH1_SMjI-1729560594932-0.0.1.1-604800000; path=\/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None" + ], + "X-Content-Type-Options": "nosniff", + "Server": "cloudflare", + "CF-RAY": "8d65b80ee97942cb-EWR", + "alt-svc": "h3=\":443\"; ma=86400" + }, + "data": "{\n \"id\": \"chatcmpl-AKy0XglWk28KEm56nQ5s8EkonCm9N\",\n \"object\": \"chat.completion\",\n \"created\": 1729560593,\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\": 1025,\n \"completion_tokens\": 15,\n \"total_tokens\": 1040,\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/Tools/SerperTestAgent-28125624c9418e220ffb104b593f9f20.json b/tests/Fixtures/Saloon/Tools/SerperTestAgent-28125624c9418e220ffb104b593f9f20.json new file mode 100644 index 0000000..3066f10 --- /dev/null +++ b/tests/Fixtures/Saloon/Tools/SerperTestAgent-28125624c9418e220ffb104b593f9f20.json @@ -0,0 +1,31 @@ +{ + "statusCode": 200, + "headers": { + "Date": "Tue, 22 Oct 2024 01:29:57 GMT", + "Content-Type": "application/json", + "Content-Length": "674", + "Connection": "keep-alive", + "access-control-expose-headers": "X-Request-ID", + "openai-organization": "user-5hvzt3x5aqwr0picqhxifwl8", + "openai-processing-ms": "778", + "openai-version": "2020-10-01", + "x-ratelimit-limit-requests": "10000", + "x-ratelimit-limit-tokens": "2000000", + "x-ratelimit-remaining-requests": "9999", + "x-ratelimit-remaining-tokens": "1999797", + "x-ratelimit-reset-requests": "6ms", + "x-ratelimit-reset-tokens": "6ms", + "x-request-id": "req_c2fbd9881a6b7a89292c13096028f737", + "strict-transport-security": "max-age=31536000; includeSubDomains; preload", + "CF-Cache-Status": "DYNAMIC", + "Set-Cookie": [ + "__cf_bm=C8t5g1M5x7bFzEEBfs.NC7QOFXARyEMQvJCpyPj0Xx0-1729560597-1.0.1.1-eydqKVILd1gSGoLl4FZrT6O6_kr_0HO2irYagsTgHcIm7qKPqG3iz6vMPbF1mvpBAosC6aPes4m2tie.KTmfHA; path=/; expires=Tue, 22-Oct-24 01:59:57 GMT; domain=.api.openai.com; HttpOnly; Secure; SameSite=None", + "_cfuvid=065oGLFxrDEEEQV3jpIU.UvhjSb9EFeKQR8oUWBrigo-1729560597771-0.0.1.1-604800000; path=/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None" + ], + "X-Content-Type-Options": "nosniff", + "Server": "cloudflare", + "CF-RAY": "8d65b822684d7c7b-EWR", + "alt-svc": "h3=\":443\"; ma=86400" + }, + "data": "{\n \"id\": \"chatcmpl-AKy0b2tUDQZmexXwAz4pWig0YDGwk\",\n \"object\": \"chat.completion\",\n \"created\": 1729560597,\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\": 300,\n \"completion_tokens\": 15,\n \"total_tokens\": 315,\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/Tools/SerperTestAgent-8c4de06e2a7064e26c30dd1131e7c149.json b/tests/Fixtures/Saloon/Tools/SerperTestAgent-8c4de06e2a7064e26c30dd1131e7c149.json new file mode 100644 index 0000000..1ea31bb --- /dev/null +++ b/tests/Fixtures/Saloon/Tools/SerperTestAgent-8c4de06e2a7064e26c30dd1131e7c149.json @@ -0,0 +1,31 @@ +{ + "statusCode": 200, + "headers": { + "Date": "Tue, 22 Oct 2024 01:29:56 GMT", + "Content-Type": "application\/json", + "Content-Length": "936", + "Connection": "keep-alive", + "access-control-expose-headers": "X-Request-ID", + "openai-organization": "user-5hvzt3x5aqwr0picqhxifwl8", + "openai-processing-ms": "890", + "openai-version": "2020-10-01", + "x-ratelimit-limit-requests": "10000", + "x-ratelimit-limit-tokens": "2000000", + "x-ratelimit-remaining-requests": "9999", + "x-ratelimit-remaining-tokens": "1999865", + "x-ratelimit-reset-requests": "6ms", + "x-ratelimit-reset-tokens": "4ms", + "x-request-id": "req_3007c8cf06d1eca2fecb7a9fb57981bc", + "strict-transport-security": "max-age=31536000; includeSubDomains; preload", + "CF-Cache-Status": "DYNAMIC", + "Set-Cookie": [ + "__cf_bm=8vuVetc9u88WEaMoNWWZaW0uISiIzo2iQCc8yY0araM-1729560596-1.0.1.1-Z_9eHUEoXhdB2m1FI7PHPX7enFnLT7Hdhr6dtLBa05TXrFfDHTKeGas016VlTL25kB0U_56ZBkT5edOGDNzOOQ; path=\/; expires=Tue, 22-Oct-24 01:59:56 GMT; domain=.api.openai.com; HttpOnly; Secure; SameSite=None", + "_cfuvid=BLsiiu1QW3zLXgej2d3jvgSGnTtmRHgdGC0ItWq9lOo-1729560596646-0.0.1.1-604800000; path=\/; domain=.api.openai.com; HttpOnly; Secure; SameSite=None" + ], + "X-Content-Type-Options": "nosniff", + "Server": "cloudflare", + "CF-RAY": "8d65b81abda64376-EWR", + "alt-svc": "h3=\":443\"; ma=86400" + }, + "data": "{\n \"id\": \"chatcmpl-AKy0ZRtZseiOkgjAWEGTheov8ENF5\",\n \"object\": \"chat.completion\",\n \"created\": 1729560595,\n \"model\": \"gpt-4-turbo-2024-04-09\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": null,\n \"tool_calls\": [\n {\n \"id\": \"call_gckflj1LwRqqPKTFyFEfIgVd\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"serper_tool\",\n \"arguments\": \"{\\\"query\\\":\\\"current president of the United States\\\"}\"\n }\n }\n ],\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"tool_calls\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 213,\n \"completion_tokens\": 20,\n \"total_tokens\": 233,\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/Traits/ValidatesOutputSchemaTestAgent-15f86e44009e468d98a2182a922488fc.json b/tests/Fixtures/Saloon/Traits/ValidatesOutputSchemaTestAgent-15f86e44009e468d98a2182a922488fc.json new file mode 100644 index 0000000..d1182af --- /dev/null +++ b/tests/Fixtures/Saloon/Traits/ValidatesOutputSchemaTestAgent-15f86e44009e468d98a2182a922488fc.json @@ -0,0 +1,10 @@ +{ + "statusCode": 200, + "headers": { + "Date": "Tue, 22 Oct 2024 01:26:14 GMT", + "Content-Type": "application\/json", + "Transfer-Encoding": "chunked", + "Connection": "keep-alive" + }, + "data": "{\n \"id\": \"chatcmpl-AKxwju2mXu9Jiq45DYAl78d38xGoB\",\n \"object\": \"chat.completion\",\n \"created\": 1729560357,\n \"model\": \"gpt-4-turbo-2024-04-09\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"{\\n \\\"pdfs\\\": [\\n {\\n \\\"link\\\": \\\"https:\/\/www.pioneerindustries.com\/var\/uploads\/STCASSEMBLIESPIOSONICSERIES2018.pdf\\\",\\n \\\"title\\\": \\\"Acoustic Assemblies\\\",\\n \\\"category\\\": \\\"Technical Data\\\",\\n \\\"product_category\\\": \\\"Door Assemblies\\\"\\n },\\n {\\n \\\"link\\\": \\\"https:\/\/www.pioneerindustries.com\/var\/uploads\/PiocaneFEMAICC500residentialsaferooms.pdf\\\",\\n \\\"title\\\": \\\"Tornado Resistant Door For Residential Safe Rooms Complies With ICC 500\\\",\\n \\\"category\\\": \\\"Technical Data\\\",\\n \\\"product_category\\\": \\\"Door Assemblies\\\"\\n },\\n {\\n \\\"link\\\": \\\"https:\/\/www.pioneerindustries.com\/var\/uploads\/PiocaneFEMAICC500SHELTERSINGLEMOTIONLOCKS.pdf\\\",\\n \\\"title\\\": \\\"Tornado Resistant Door For Shelters With Single Motion Locks Complies With ICC 500\\\",\\n \\\"category\\\": \\\"Technical Data\\\",\\n \\\"product_category\\\": \\\"Door Assemblies\\\"\\n },\\n {\\n \\\"link\\\": \\\"https:\/\/www.pioneerindustries.com\/var\/uploads\/Piocane50StorefrontHVHZ11.pdf\\\",\\n \\\"title\\\": \\\"+\/- 50 Psf Hurricane Rated Storefront Assembly\\\",\\n \\\"category\\\": \\\"Technical Data\\\",\\n \\\"product_category\\\": \\\"Door Assemblies\\\"\\n },\\n {\\n \\\"link\\\": \\\"https:\/\/www.pioneerindustries.com\/var\/uploads\/PIOCANE50FG.pdf\\\",\\n \\\"title\\\": \\\"+\/- 50 Psf Hurricane Rated Door Assembly\\\",\\n \\\"category\\\": \\\"Technical Data\\\",\\n \\\"product_category\\\": \\\"Door Assemblies\\\"\\n },\\n {\\n \\\"link\\\": \\\"https:\/\/www.pioneerindustries.com\/var\/uploads\/Piocane70HVHZ1.pdf\\\",\\n \\\"title\\\": \\\"+\/- 70 Psf Hurricane Rated Door Assembly\\\",\\n \\\"category\\\": \\\"Technical Data\\\",\\n \\\"product_category\\\": \\\"Door Assemblies\\\"\\n },\\n {\\n \\\"link\\\": \\\"https:\/\/www.pioneerindustries.com\/var\/uploads\/1-PIOCANE-50FG.pdf\\\",\\n \\\"title\\\": \\\"+\/- 50 Psf Hurricane Rated Full Glass Door Assembly\\\",\\n \\\"category\\\": \\\"Technical Data\\\",\\n \\\"product_category\\\": \\\"Door Assemblies\\\"\\n },\\n {\\n \\\"link\\\": \\\"https:\/\/www.pioneerindustries.com\/var\/uploads\/SBR16.pdf\\\",\\n \\\"title\\\": \\\"Engineering Details For Blast Resistant Door Assembly\\\",\\n \\\"category\\\": \\\"Technical Data\\\",\\n \\\"product_category\\\": \\\"Door Assemblies\\\"\\n },\\n {\\n \\\"link\\\": \\\"https:\/\/www.pioneerindustries.com\/var\/uploads\/BR752DOORASSEMBLY.pdf\\\",\\n \\\"title\\\": \\\"Bullet Resistant Door Complies With UL 752 Level 1 And Level 3\\\",\\n \\\"category\\\": \\\"Technical Data\\\",\\n \\\"product_category\\\": \\\"Door Assemblies\\\"\\n }\\n ]\\n}\\n```\",\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 1985,\n \"completion_tokens\": 609,\n \"total_tokens\": 2594,\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/Traits/ValidatesOutputSchemaTestAgent-39bc17d178807a04cb3b9318f2573b99.json b/tests/Fixtures/Saloon/Traits/ValidatesOutputSchemaTestAgent-39bc17d178807a04cb3b9318f2573b99.json new file mode 100644 index 0000000..9744743 --- /dev/null +++ b/tests/Fixtures/Saloon/Traits/ValidatesOutputSchemaTestAgent-39bc17d178807a04cb3b9318f2573b99.json @@ -0,0 +1,10 @@ +{ + "statusCode": 200, + "headers": { + "Date": "Tue, 22 Oct 2024 01:25:57 GMT", + "Content-Type": "application\/json", + "Transfer-Encoding": "chunked", + "Connection": "keep-alive" + }, + "data": "{\n \"id\": \"chatcmpl-AKxwRsoeeJ1sH3EPs1aVo6qG616Xq\",\n \"object\": \"chat.completion\",\n \"created\": 1729560339,\n \"model\": \"gpt-4-turbo-2024-04-09\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"{\\n \\\"pdfs\\\": [\\n {\\n \\\"link\\\": \\\"https:\/\/www.pioneerindustries.com\/var\/uploads\/STCASSEMBLIESPIOSONICSERIES2018.pdf\\\",\\n \\\"title\\\": \\\"Acoustic Assemblies\\\",\\n \\\"category\\\": \\\"Technical Data\\\",\\n \\\"product_category\\\": \\\"Door Assemblies\\\"\\n },\\n {\\n \\\"link\\\": \\\"https:\/\/www.pioneerindustries.com\/var\/uploads\/PiocaneFEMAICC500residentialsaferooms.pdf\\\",\\n \\\"title\\\": \\\"Tornado Resistant Door For Residential Safe Rooms Complies With ICC 500\\\",\\n \\\"category\\\": \\\"Technical Data\\\",\\n \\\"product_category\\\": \\\"Door Assemblies\\\"\\n },\\n {\\n \\\"link\\\": \\\"https:\/\/www.pioneerindustries.com\/var\/uploads\/PiocaneFEMAICC500SHELTERSINGLEMOTIONLOCKS.pdf\\\",\\n \\\"title\\\": \\\"Tornado Resistant Door For Shelters With Single Motion Locks Complies With ICC 500\\\",\\n \\\"category\\\": \\\"Technical Data\\\",\\n \\\"product_category\\\": \\\"Door Assemblies\\\"\\n },\\n {\\n \\\"link\\\": \\\"https:\/\/www.pioneerindustries.com\/var\/uploads\/Piocane50StorefrontHVHZ11.pdf\\\",\\n \\\"title\\\": \\\"+\/- 50 Psf Hurricane Rated Storefront Assembly\\\",\\n \\\"category\\\": \\\"Technical Data\\\",\\n \\\"product_category\\\": \\\"Door Assemblies\\\"\\n },\\n {\\n \\\"link\\\": \\\"https:\/\/www.pioneerindustries.com\/var\/uploads\/PIOCANE50FG.pdf\\\",\\n \\\"title\\\": \\\"+\/-50 Psf Hurricane Rated Door Assembly\\\",\\n \\\"category\\\": \\\"Technical Data\\\",\\n \\\"product_category\\\": \\\"Door Assemblies\\\"\\n },\\n {\\n \\\"link\\\": \\\"https:\/\/www.pioneerindustries.com\/var\/uploads\/Piocane70HVHZ1.pdf\\\",\\n \\\"title\\\": \\\"+\/- 70 Psf Hurricane Rated Door Assembly\\\",\\n \\\"category\\\": \\\"Technical Data\\\",\\n \\\"product_category\\\": \\\"Door Assemblies\\\"\\n },\\n {\\n \\\"link\\\": \\\"https:\/\/www.pioneerindustries.com\/var\/uploads\/1-PIOCANE-50 FG.pdf\\\",\\n \\\"title\\\": \\\"+\/- 50 Psf Hurricane Rated Full Glass Door Assembly\\\",\\n \\\"category\\\": \\\"Technical Data\\\",\\n \\\"product_category\\\": \\\"Door Assemblies\\\"\\n },\\n {\\n \\\"link\\\": \\\"https:\/\/www.pioneerindustries.com\/var\/uploads\/SBR16.pdf\\\",\\n \\\"title\\\": \\\"Engineering Details For Blast Resistant Door Assembly\\\",\\n \\\"category\\\": \\\"Technical Data\\\",\\n \\\"product_category\\\": \\\"Door Assemblies\\\"\\n },\\n {\\n \\\"link\\\": \\\"https:\/\/www.pioneerindustries.com\/var\/uploads\/BR752DOORASSEMBLY.pdf\\\",\\n \\\"title\\\": \\\"Bullet Resistant Door Complies With UL 752 Level 1 And Level3\\\",\\n \\\"category\\\": \\\"Technical Data\\\",\\n \\\"product_category\\\": \\\"Door Assemblies\\\"\\n }\\n ]\\n}\\n```\",\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 1119,\n \"completion_tokens\": 607,\n \"total_tokens\": 1726,\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 d16e855..2e8909c 100644 --- a/tests/Integrations/ClaudeIntegrationTest.php +++ b/tests/Integrations/ClaudeIntegrationTest.php @@ -2,6 +2,7 @@ declare(strict_types=1); + use Saloon\Http\Faking\Fixture; use Saloon\Http\Faking\MockClient; use Saloon\Http\Faking\MockResponse; use Saloon\Http\PendingRequest; @@ -91,10 +92,9 @@ protected function resolveTools(): array } 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("Integrations/ClaudeTestAgent-{$hash}"); + return MockResponse::fixture("Integrations/ClaudeToolTestAgent-{$hash}"); }, SerperSearchRequest::class => MockResponse::fixture('Integrations/ClaudeTestAgent-Serper-Tool'), ]); @@ -105,5 +105,6 @@ protected function resolveTools(): array $agentResponseArray = $message->toArray(); expect($agentResponseArray['content'])->toBeArray() - ->and($agentResponseArray['content'])->toHaveKey('answer'); + ->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.'); }); diff --git a/tests/Integrations/OllamaIntegrationTest.php b/tests/Integrations/OllamaIntegrationTest.php new file mode 100644 index 0000000..e2d9484 --- /dev/null +++ b/tests/Integrations/OllamaIntegrationTest.php @@ -0,0 +1,110 @@ + 'answer', + 'rules' => 'required|string', + 'description' => 'your final answer to the query.', + ]), + ]; + } + } + + MockClient::global([ + ChatRequest::class => function (PendingRequest $pendingRequest): Fixture { + $hash = md5(json_encode($pendingRequest->body()->get('messages'))); + + return MockResponse::fixture("Integrations/OllamaTestAgent-{$hash}"); + }, + ]); + + $agent = new OllamaTestAgent; + $message = $agent->handle(['input' => 'hello!']); + + $agentResponseArray = $message->toArray(); + + expect($agentResponseArray['content'])->toBeArray() + ->and($agentResponseArray['content'])->toHaveKey('answer') + ->and($agentResponseArray['content']['answer'])->toBe('Hello!'); +}); + +test('uses tools', function (): void { + + class OllamaToolTestAgent extends Agent implements HasIntegration + { + use ValidatesOutputSchema; + + protected string $promptView = 'synapse::Prompts.SimplePrompt'; + + public function resolveIntegration(): Integration + { + return new OllamaIntegration; + } + + public function resolveOutputSchema(): array + { + return [ + SchemaRule::make([ + 'name' => 'answer', + 'rules' => 'required|string', + 'description' => 'your final answer to the query.', + ]), + ]; + } + + protected function resolveTools(): array + { + return [new SerperTool]; + } + } + + MockClient::global([ + ChatRequest::class => function (PendingRequest $pendingRequest): \Saloon\Http\Faking\Fixture { + + $hash = md5(json_encode($pendingRequest->body()->get('messages'))); + + return MockResponse::fixture("Integrations/OllamaToolTestAgent-{$hash}"); + }, + SerperSearchRequest::class => MockResponse::fixture('Integrations/OllamaTestAgent-Serper-Tool'), + ]); + + $agent = new OllamaToolTestAgent; + $message = $agent->handle(['input' => 'search google for the current president of the united states.']); + + $agentResponseArray = $message->toArray(); + + expect($agentResponseArray['content'])->toBeArray() + ->and($agentResponseArray['content'])->toHaveKey('answer') + ->and($agentResponseArray['content']['answer'])->toBe('The current President of the United States is Joe Biden.'); +}); diff --git a/tests/Integrations/OpenAiIntegrationTest.php b/tests/Integrations/OpenAiIntegrationTest.php index 15883fd..086cb9b 100644 --- a/tests/Integrations/OpenAiIntegrationTest.php +++ b/tests/Integrations/OpenAiIntegrationTest.php @@ -2,21 +2,22 @@ declare(strict_types=1); -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\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\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 { @@ -46,7 +47,8 @@ public function resolveOutputSchema(): array $agentResponseArray = $message->toArray(); expect($agentResponseArray['content'])->toBeArray() - ->and($agentResponseArray['content'])->toHaveKey('answer'); + ->and($agentResponseArray['content'])->toHaveKey('answer') + ->and($agentResponseArray['content']['answer'])->toBe('Hello! How can I assist you today?'); }); test('Connects', function (): void { @@ -84,30 +86,8 @@ public function resolveOutputSchema(): array $agentResponseArray = $message->toArray(); expect($agentResponseArray['content'])->toBeArray() - ->and($agentResponseArray['content'])->toHaveKey('answer'); -}); - -test('Connects With OutputSchema', function (): void { - - class OpenAiConnectsTestAgent extends Agent implements HasIntegration - { - protected string $promptView = 'synapse::Prompts.SimplePrompt'; - - public function resolveIntegration(): Integration - { - return new OpenAIIntegration; - } - } - - MockClient::global([ - ChatRequest::class => MockResponse::fixture('Integrations/OpenAiTestAgent'), - ]); - - $agent = new OpenAiConnectsTestAgent; - $message = $agent->handle(['input' => 'hello!']); - - $agentResponseArray = $message->toArray(); - expect($agentResponseArray['content'])->not->toBeArray(); + ->and($agentResponseArray['content'])->toHaveKey('answer') + ->and($agentResponseArray['content']['answer'])->toBe('Hello!'); }); test('uses tools', function (): void { @@ -141,7 +121,7 @@ protected function resolveTools(): array } 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("Integrations/OpenAiToolTestAgent-{$hash}"); @@ -155,5 +135,6 @@ protected function resolveTools(): array $agentResponseArray = $message->toArray(); expect($agentResponseArray['content'])->toBeArray() - ->and($agentResponseArray['content'])->toHaveKey('answer'); + ->and($agentResponseArray['content'])->toHaveKey('answer') + ->and($agentResponseArray['content']['answer'])->toBe('Joe Biden is the current President of the United States.'); }); diff --git a/tests/Memory/CollectionMemoryTest.php b/tests/Memory/CollectionMemoryTest.php index 21c3457..5ec006d 100644 --- a/tests/Memory/CollectionMemoryTest.php +++ b/tests/Memory/CollectionMemoryTest.php @@ -2,21 +2,21 @@ declare(strict_types=1); -use Saloon\Http\Faking\MockClient; -use Saloon\Http\Faking\MockResponse; -use Saloon\Http\PendingRequest; -use UseTheFork\Synapse\Agent; -use UseTheFork\Synapse\Contracts\Agent\HasMemory; -use UseTheFork\Synapse\Contracts\Integration; -use UseTheFork\Synapse\Contracts\Memory; -use UseTheFork\Synapse\Integrations\Connectors\OpenAI\Requests\ChatRequest; -use UseTheFork\Synapse\Integrations\OpenAIIntegration; -use UseTheFork\Synapse\Memory\CollectionMemory; -use UseTheFork\Synapse\Traits\Agent\ManagesMemory; -use UseTheFork\Synapse\Traits\Agent\ValidatesOutputSchema; -use UseTheFork\Synapse\ValueObject\SchemaRule; + use Saloon\Http\Faking\MockClient; + use Saloon\Http\Faking\MockResponse; + use Saloon\Http\PendingRequest; + use UseTheFork\Synapse\Agent; + use UseTheFork\Synapse\Contracts\Agent\HasMemory; + use UseTheFork\Synapse\Contracts\Integration; + use UseTheFork\Synapse\Contracts\Memory; + use UseTheFork\Synapse\Integrations\Connectors\OpenAI\Requests\ChatRequest; + use UseTheFork\Synapse\Integrations\OpenAIIntegration; + use UseTheFork\Synapse\Memory\CollectionMemory; + use UseTheFork\Synapse\Traits\Agent\ManagesMemory; + use UseTheFork\Synapse\Traits\Agent\ValidatesOutputSchema; + use UseTheFork\Synapse\ValueObject\SchemaRule; -it('Collection Memory', function (): void { + it('Collection Memory', function (): void { class CollectionMemoryAgent extends Agent implements HasMemory { @@ -67,6 +67,6 @@ public function resolveMemory(): Memory $followupResponseArray = $followup->toArray(); expect($followupResponseArray['content'])->toBeArray() ->and($followupResponseArray['content'])->toHaveKey('answer') - ->and($followupResponseArray['content']['answer'])->toBe('.sdrawkcab tuB ?yas tsuj I did tahw'); + ->and($followupResponseArray['content']['answer'])->toBe('?sdrawkcaB .yas tsuj I did tahw'); }); diff --git a/tests/Memory/ConversationSummaryMemoryTest.php b/tests/Memory/ConversationSummaryMemoryTest.php index 1f79b8a..eb2df21 100644 --- a/tests/Memory/ConversationSummaryMemoryTest.php +++ b/tests/Memory/ConversationSummaryMemoryTest.php @@ -2,23 +2,23 @@ declare(strict_types=1); - use Saloon\Http\Faking\MockClient; - use Saloon\Http\Faking\MockResponse; - use Saloon\Http\PendingRequest; - use UseTheFork\Synapse\Agent; - use UseTheFork\Synapse\Contracts\Agent\HasMemory; - use UseTheFork\Synapse\Contracts\Integration; - use UseTheFork\Synapse\Contracts\Memory; - use UseTheFork\Synapse\Integrations\Connectors\OpenAI\Requests\ChatRequest; - use UseTheFork\Synapse\Integrations\OpenAIIntegration; - use UseTheFork\Synapse\Memory\ConversationSummaryMemory; - use UseTheFork\Synapse\Services\Serper\Requests\SerperSearchRequest; - use UseTheFork\Synapse\Tools\SerperTool; - use UseTheFork\Synapse\Traits\Agent\ManagesMemory; - use UseTheFork\Synapse\Traits\Agent\ValidatesOutputSchema; - use UseTheFork\Synapse\ValueObject\SchemaRule; - - it('Conversation Summary Memory', function (): void { +use Saloon\Http\Faking\MockClient; +use Saloon\Http\Faking\MockResponse; +use Saloon\Http\PendingRequest; +use UseTheFork\Synapse\Agent; +use UseTheFork\Synapse\Contracts\Agent\HasMemory; +use UseTheFork\Synapse\Contracts\Integration; +use UseTheFork\Synapse\Contracts\Memory; +use UseTheFork\Synapse\Integrations\Connectors\OpenAI\Requests\ChatRequest; +use UseTheFork\Synapse\Integrations\OpenAIIntegration; +use UseTheFork\Synapse\Memory\ConversationSummaryMemory; +use UseTheFork\Synapse\Services\Serper\Requests\SerperSearchRequest; +use UseTheFork\Synapse\Tools\SerperTool; +use UseTheFork\Synapse\Traits\Agent\ManagesMemory; +use UseTheFork\Synapse\Traits\Agent\ValidatesOutputSchema; +use UseTheFork\Synapse\ValueObject\SchemaRule; + +it('Conversation Summary Memory', function (): void { class ConversationSummaryAgent extends Agent implements HasMemory { @@ -63,24 +63,24 @@ public function resolveMemory(): Memory $memory = $agent->memory()->get(); - expect($memory[0]->content())->toContain('The user\'s message says "hello this a test". The assistant responded with "Hello! How can I assist you today?') - ->and($agentResponseArray['content'])->toBeArray() - ->and($agentResponseArray['content'])->toHaveKey('answer') - ->and($agentResponseArray['content']['answer'])->toBe('Hello! How can I assist you today?'); + expect($memory[0]->content())->toContain('The user\'s message says "hello this a test" and the assistant responds with "hello this a test".') + ->and($agentResponseArray['content'])->toBeArray() + ->and($agentResponseArray['content'])->toHaveKey('answer') + ->and($agentResponseArray['content']['answer'])->toBe('hello this a test'); $followup = $agent->handle(['input' => 'what did I just say? But Backwards.']); $memory = $agent->memory()->get(); $followupResponseArray = $followup->toArray(); - expect($memory[0]->content())->toContain('The user\'s message says "hello this a test". The assistant responded with "Hello! How can I assist you today?" Following this, the user asked what they just said but backwards. The assistant replied with "tset a si siht olleh".') - ->and($followupResponseArray['content'])->toBeArray() - ->and($followupResponseArray['content'])->toHaveKey('answer') - ->and($followupResponseArray['content']['answer'])->toBe('tset a si siht olleh'); + expect($memory[0]->content())->toContain('The user\'s message says "hello this a test" and the assistant responds with "hello this a test".') + ->and($followupResponseArray['content'])->toBeArray() + ->and($followupResponseArray['content'])->toHaveKey('answer') + ->and($followupResponseArray['content']['answer'])->toBe('tset a si siht olleh'); }); - it('Conversation Summary Memory With Tools', function (): void { +it('Conversation Summary Memory With Tools', function (): void { class ConversationSummaryWithToolsAgent extends Agent implements HasMemory { @@ -114,7 +114,6 @@ protected function resolveTools(): array { return [new SerperTool]; } - } MockClient::global([ @@ -123,7 +122,7 @@ protected function resolveTools(): array return MockResponse::fixture("Memory/ConversationSummaryWithToolsAgent-{$hash}"); }, - SerperSearchRequest::class => function (PendingRequest $pendingRequest): \Saloon\Http\Faking\Fixture { + SerperSearchRequest::class => function (PendingRequest $pendingRequest): \Saloon\Http\Faking\Fixture { $hash = md5(json_encode($pendingRequest->body()->get('messages'))); return MockResponse::fixture("Memory/ConversationSummaryWithToolsAgent-Tool-{$hash}"); @@ -136,19 +135,19 @@ protected function resolveTools(): array $memory = $agent->memory()->get(); - expect($memory[0]->content())->toContain('The user requested to search Google to find out who the current President of the United States is. The search returned results identifying Joe Biden as the current President, serving as the 46th president since 2021. Various sources including the official White House website and Wikipedia confirm this information. The assistant affirmed that Joe Biden is the current President of the United States.') - ->and($agentResponseArray['content'])->toBeArray() - ->and($agentResponseArray['content'])->toHaveKey('answer') - ->and($agentResponseArray['content']['answer'])->toBe('Joe Biden is the current President of the United States.'); + expect($memory[0]->content())->toContain('The user requested to search Google for the current President of the United States. Using the serper_tool, the results showed multiple references confirming that Joe Biden is the current President of the United States, serving as the 46th president since 2021. The assistant confirmed that Joe Biden is indeed the current President of the United States.') + ->and($agentResponseArray['content'])->toBeArray() + ->and($agentResponseArray['content'])->toHaveKey('answer') + ->and($agentResponseArray['content']['answer'])->toBe('Joe Biden is the current President of the United States.'); $followup = $agent->handle(['input' => 'What about the Vice President?']); $memory = $agent->memory()->get(); $followupResponseArray = $followup->toArray(); - expect($memory[0]->content())->toContain('The user inquired about the current Vice President of the United States following their earlier question about the President, and was informed that the current Vice President is Kamala Harris.') - ->and($followupResponseArray['content'])->toBeArray() - ->and($followupResponseArray['content'])->toHaveKey('answer') - ->and($followupResponseArray['content']['answer'])->toBe('The current Vice President of the United States is Kamala Harris.'); + expect($memory[0]->content())->toContain('The user wanted to know about the Vice President following the confirmation that Joe Biden is the current President of the United States. The Vice President following Joe Biden is Kamala Harris.') + ->and($followupResponseArray['content'])->toBeArray() + ->and($followupResponseArray['content'])->toHaveKey('answer') + ->and($followupResponseArray['content']['answer'])->toBe('The Vice President of the United States following Joe Biden is Kamala Harris.'); }); diff --git a/tests/Memory/DatabaseMemoryTest.php b/tests/Memory/DatabaseMemoryTest.php index b5f67dc..0897e21 100644 --- a/tests/Memory/DatabaseMemoryTest.php +++ b/tests/Memory/DatabaseMemoryTest.php @@ -72,7 +72,7 @@ public function resolveMemory(): Memory $followupResponseArray = $followup->toArray(); expect($followupResponseArray['content'])->toBeArray() ->and($followupResponseArray['content'])->toHaveKey('answer') - ->and($followupResponseArray['content']['answer'])->toBe('.sdrawkcab yas tsuj I did tahw'); + ->and($followupResponseArray['content']['answer'])->toBe('.sdrawkcab tuB ?yas tsuj I did tahw'); $this->assertDatabaseCount('agent_memories', 1); $this->assertDatabaseCount('messages', 4); diff --git a/tests/Tools/ClearbitCompanyToolTest.php b/tests/Tools/ClearbitCompanyToolTest.php index 65a8120..1b68000 100644 --- a/tests/Tools/ClearbitCompanyToolTest.php +++ b/tests/Tools/ClearbitCompanyToolTest.php @@ -70,7 +70,7 @@ protected function resolveTools(): array $agentResponseArray = $message->toArray(); expect($agentResponseArray['content'])->toBeArray() ->and($agentResponseArray['content'])->toHaveKey('answer') - ->and($agentResponseArray['content']['answer'])->toContain('OpenAI is an AI research company focused on safe and beneficial artificial intelligence for all, prioritizing human values and diversity in technology.'); + ->and($agentResponseArray['content']['answer'])->toContain('OpenAI, legally known as OpenAI, Inc., is an AI research company dedicated to developing safe and beneficial artificial intelligence that aligns with human values and promotes diversity in technology.'); }); diff --git a/tests/Tools/CrunchbaseToolTest.php b/tests/Tools/CrunchbaseToolTest.php index 34d2ee9..e8ffae3 100644 --- a/tests/Tools/CrunchbaseToolTest.php +++ b/tests/Tools/CrunchbaseToolTest.php @@ -2,25 +2,25 @@ 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\HasOutputSchema; -use UseTheFork\Synapse\Contracts\Integration; -use UseTheFork\Synapse\Contracts\Memory; -use UseTheFork\Synapse\Contracts\Tool; -use UseTheFork\Synapse\Integrations\Connectors\OpenAI\Requests\ChatRequest; -use UseTheFork\Synapse\Integrations\OpenAIIntegration; -use UseTheFork\Synapse\Memory\CollectionMemory; -use UseTheFork\Synapse\Services\Crunchbase\Requests\CrunchbaseRequest; -use UseTheFork\Synapse\Tools\BaseTool; -use UseTheFork\Synapse\Tools\CrunchbaseTool; -use UseTheFork\Synapse\Traits\Agent\ValidatesOutputSchema; -use UseTheFork\Synapse\ValueObject\SchemaRule; - -test('Crunchbase Tool', 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\HasOutputSchema; + use UseTheFork\Synapse\Contracts\Integration; + use UseTheFork\Synapse\Contracts\Memory; + use UseTheFork\Synapse\Contracts\Tool; + use UseTheFork\Synapse\Integrations\Connectors\OpenAI\Requests\ChatRequest; + use UseTheFork\Synapse\Integrations\OpenAIIntegration; + use UseTheFork\Synapse\Memory\CollectionMemory; + use UseTheFork\Synapse\Services\Crunchbase\Requests\CrunchbaseRequest; + use UseTheFork\Synapse\Tools\BaseTool; + use UseTheFork\Synapse\Tools\CrunchbaseTool; + use UseTheFork\Synapse\Traits\Agent\ValidatesOutputSchema; + use UseTheFork\Synapse\ValueObject\SchemaRule; + + test('Crunchbase Tool', function (): void { class CrunchbaseToolTestAgent extends Agent implements HasOutputSchema { @@ -70,7 +70,7 @@ protected function resolveTools(): array $agentResponseArray = $message->toArray(); expect($agentResponseArray['content'])->toBeArray() ->and($agentResponseArray['content'])->toHaveKey('answer') - ->and($agentResponseArray['content']['answer'])->toContain('Siteimprove offers comprehensive cloud-based digital presence optimization software. This company is based in Copenhagen, Denmark, and has a presence across multiple locations including Hovedstaden and the broader European region.'); + ->and($agentResponseArray['content']['answer'])->toContain('Siteimprove offers comprehensive cloud-based digital presence optimization software. Located in Copenhagen, Denmark, the company also has locations in Hovedstade'); }); diff --git a/tests/Tools/FirecrawlToolTest.php b/tests/Tools/FirecrawlToolTest.php index f5ac890..2a59c9e 100644 --- a/tests/Tools/FirecrawlToolTest.php +++ b/tests/Tools/FirecrawlToolTest.php @@ -70,7 +70,7 @@ protected function resolveTools(): array $agentResponseArray = $message->toArray(); expect($agentResponseArray['content'])->toBeArray() ->and($agentResponseArray['content'])->toHaveKey('answer') - ->and($agentResponseArray['content']['answer'])->toContain("webpage is about Firecrawl, a web scraping tool designed for extracting, cleaning, and converting web data into formats suitable for AI applications, especially Large Language Models (LLMs). It features capabilities to crawl pages, handle dynamic content, and provide data in clean markdown or structured formats. It targets LLM engineers, data scientists, and AI researchers"); + ->and($agentResponseArray['content']['answer'])->toContain("The website 'https://www.firecrawl.dev/' is about Firecrawl, a web scraping tool designed for extracting, cleaning, and converting web data into formats suitable for AI applications, particularly Large Language Models (LLMs)."); }); diff --git a/tests/Tools/SQLToolTest.php b/tests/Tools/SQLToolTest.php index 120697d..360ecfc 100644 --- a/tests/Tools/SQLToolTest.php +++ b/tests/Tools/SQLToolTest.php @@ -105,7 +105,7 @@ protected function resolveTools(): array $agentResponseArray = $message->toArray(); expect($agentResponseArray['content'])->toBeArray() ->and($agentResponseArray['content'])->toHaveKey('answer') - ->and($agentResponseArray['content']['answer'])->toContain('There are 100 organizations operating with an average of 5 funding rounds each.'); + ->and($agentResponseArray['content']['answer'])->toContain('There are 100 organizations currently operating, with an average of 5 funding rounds each.'); }); diff --git a/tests/Tools/SerpAPIGoogleNewsToolTest.php b/tests/Tools/SerpAPIGoogleNewsToolTest.php index 5d5989d..08300a0 100644 --- a/tests/Tools/SerpAPIGoogleNewsToolTest.php +++ b/tests/Tools/SerpAPIGoogleNewsToolTest.php @@ -2,26 +2,26 @@ 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\HasOutputSchema; -use UseTheFork\Synapse\Contracts\Integration; -use UseTheFork\Synapse\Contracts\Memory; -use UseTheFork\Synapse\Contracts\Tool; -use UseTheFork\Synapse\Integrations\Connectors\OpenAI\Requests\ChatRequest; -use UseTheFork\Synapse\Integrations\OpenAIIntegration; -use UseTheFork\Synapse\Memory\CollectionMemory; -use UseTheFork\Synapse\Services\SerpApi\Requests\SerpApiSearchRequest; -use UseTheFork\Synapse\Tools\BaseTool; -use UseTheFork\Synapse\Tools\SerpAPIGoogleNewsTool; -use UseTheFork\Synapse\Tools\SerpAPIGoogleSearchTool; -use UseTheFork\Synapse\Traits\Agent\ValidatesOutputSchema; -use UseTheFork\Synapse\ValueObject\SchemaRule; - -test('Serp API Google News Tool', 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\HasOutputSchema; + use UseTheFork\Synapse\Contracts\Integration; + use UseTheFork\Synapse\Contracts\Memory; + use UseTheFork\Synapse\Contracts\Tool; + use UseTheFork\Synapse\Integrations\Connectors\OpenAI\Requests\ChatRequest; + use UseTheFork\Synapse\Integrations\OpenAIIntegration; + use UseTheFork\Synapse\Memory\CollectionMemory; + use UseTheFork\Synapse\Services\SerpApi\Requests\SerpApiSearchRequest; + use UseTheFork\Synapse\Tools\BaseTool; + use UseTheFork\Synapse\Tools\SerpAPIGoogleNewsTool; + use UseTheFork\Synapse\Tools\SerpAPIGoogleSearchTool; + use UseTheFork\Synapse\Traits\Agent\ValidatesOutputSchema; + use UseTheFork\Synapse\ValueObject\SchemaRule; + + test('Serp API Google News Tool', function (): void { class SerpAPIGoogleNewsToolTestAgent extends Agent implements HasOutputSchema { @@ -71,7 +71,7 @@ protected function resolveTools(): array $agentResponseArray = $message->toArray(); expect($agentResponseArray['content'])->toBeArray() ->and($agentResponseArray['content'])->toHaveKey('answer') - ->and($agentResponseArray['content']['answer'])->toContain("Recent headlines about Apple include news on the expected discontinuation of some Apple products next month, the debut of macOS, iPadOS, and watchOS updates, and details on the newly unveiled iPhone 16 at the 'Glowtime' event."); + ->and($agentResponseArray['content']['answer'])->toContain("Current headlines about Apple include news about potential discontinuation of some products, sales predictions for the iPhone 16 series based on Apple Intelligence"); }); diff --git a/tests/Tools/SerpAPIGoogleSearchToolTest.php b/tests/Tools/SerpAPIGoogleSearchToolTest.php index 2538260..be9fb01 100644 --- a/tests/Tools/SerpAPIGoogleSearchToolTest.php +++ b/tests/Tools/SerpAPIGoogleSearchToolTest.php @@ -70,7 +70,7 @@ protected function resolveTools(): array $agentResponseArray = $message->toArray(); 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'); });