Skip to content

Commit

Permalink
Merge pull request #2 from use-the-fork/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
use-the-fork authored Oct 16, 2024
2 parents 2881237 + 96c422b commit 9c28442
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/update-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: main
token: ${{ secrets.COMMIT_TOKEN }}
Expand Down
4 changes: 2 additions & 2 deletions tests/Agents/SQLToolAgentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@

MockClient::global([
ChatRequest::class => function (PendingRequest $pendingRequest): \Saloon\Http\Faking\Fixture {
$count = md5(json_encode($pendingRequest->body()->all()));
$count = md5(json_encode($pendingRequest->body()->get('messages')));

return MockResponse::fixture("Agents/SQLToolAgent-{$count}");
},
Expand All @@ -60,5 +60,5 @@
$agentResponseArray = $message->toArray();
expect($agentResponseArray['content'])->toBeArray()
->and($agentResponseArray['content'])->toHaveKey('answer')
->and($agentResponseArray['content']['answer'])->toContain('There are 100 organizations currently operating, and the average number of funding rounds for them is 5.');
->and($agentResponseArray['content']['answer'])->toContain('There are 100 operating organizations and the average number of funding rounds for them is 5.');
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"statusCode": 200,
"headers": {
"Date": "Wed, 16 Oct 2024 23:53:58 GMT",
"Content-Type": "application/json",
"Content-Length": "925",
"Connection": "keep-alive"
},
"data": "{\n \"id\": \"chatcmpl-AJ87xAJ2JNm18lP8fPhsoJsYHrEc2\",\n \"object\": \"chat.completion\",\n \"created\": 1729122837,\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_YRRYKdXqKRF2k1PUQXPqNujy\",\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\": 449,\n \"completion_tokens\": 18,\n \"total_tokens\": 467,\n \"prompt_tokens_details\": {\n \"cached_tokens\": 0\n },\n \"completion_tokens_details\": {\n \"reasoning_tokens\": 0\n }\n },\n \"system_fingerprint\": \"fp_83975a045a\"\n}\n"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"statusCode": 200,
"headers": {
"Date": "Wed, 16 Oct 2024 23:53:57 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": "819",
"openai-version": "2020-10-01"
},
"data": "{\n \"id\": \"chatcmpl-AJ87wCMef7zUWGnJeUmY6NmE570vD\",\n \"object\": \"chat.completion\",\n \"created\": 1729122836,\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_yyXdaOAyYq3qDCmDwDEcC9cB\",\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\": 388,\n \"completion_tokens\": 14,\n \"total_tokens\": 402,\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"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"statusCode": 200,
"headers": {
"Date": "Wed, 16 Oct 2024 23:54:01 GMT",
"Content-Type": "application\/json",
"Content-Length": "1054",
"Connection": "keep-alive"
},
"data": "{\n \"id\": \"chatcmpl-AJ87zexuBFOyNj25s7F3amktioBRM\",\n \"object\": \"chat.completion\",\n \"created\": 1729122839,\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_fa4zFfmXKbS7y0rEE0N44CSe\",\n \"type\": \"function\",\n \"function\": {\n \"name\": \"query_s_q_l_data_base_tool\",\n \"arguments\": \"{\\\"query\\\":\\\"SELECT COUNT(*) AS 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\": 1170,\n \"completion_tokens\": 48,\n \"total_tokens\": 1218,\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"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"statusCode": 200,
"headers": {
"Date": "Wed, 16 Oct 2024 23:54:03 GMT",
"Content-Type": "application/json",
"Content-Length": "760"
},
"data": "{\n \"id\": \"chatcmpl-AJ8823rTNyertHrdfwPsPmeB0793E\",\n \"object\": \"chat.completion\",\n \"created\": 1729122842,\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 operating organizations and the average number of funding rounds for them is 5.\\\"\\n}\\n```\",\n \"refusal\": null\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ],\n \"usage\": {\n \"prompt_tokens\": 1248,\n \"completion_tokens\": 31,\n \"total_tokens\": 1279,\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"
}

0 comments on commit 9c28442

Please sign in to comment.