Skip to content

Commit

Permalink
Move the Tools class to the com.openai.tools package
Browse files Browse the repository at this point in the history
  • Loading branch information
thekid committed Nov 2, 2024
1 parent ddb1cdd commit 8f16172
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 12 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,7 @@ Custom functions are registered in a `Functions` instance and passed via *tools*

```php
use com\openai\rest\OpenAIEndpoint;
use com\openai\Tools;
use com\openai\tools\Functions;
use com\openai\tools\{Tools, Functions};

$functions= (new Functions())->register('weather', new Weather());

Expand Down
3 changes: 1 addition & 2 deletions src/main/php/com/openai/realtime/RealtimeApi.class.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?php namespace com\openai\realtime;

use com\openai\Tools;
use com\openai\tools\Functions;
use com\openai\tools\{Tools, Functions};
use lang\{IllegalStateException, Value};
use text\json\Json;
use util\data\Marshalling;
Expand Down
3 changes: 1 addition & 2 deletions src/main/php/com/openai/rest/RestEndpoint.class.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?php namespace com\openai\rest;

use com\openai\Tools;
use com\openai\tools\Functions;
use com\openai\tools\{Tools, Functions};

/** Base class for OpenAI and AzureAI implementations */
abstract class RestEndpoint extends ApiEndpoint {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<?php namespace com\openai;

use com\openai\tools\Functions;
<?php namespace com\openai\tools;

/**
* Tools
* Tools incorporate the builtins like `code_interpreter` but also custom
* functions declared via `Functions` registry.
*
* @test com.openai.unittest.ToolsTest
* @see https://platform.openai.com/docs/assistants/tools
Expand Down
3 changes: 1 addition & 2 deletions src/test/php/com/openai/unittest/ToolsTest.class.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<?php namespace com\openai\unittest;

use com\openai\Tools;
use com\openai\realtime\RealtimeApi;
use com\openai\rest\OpenAIEndpoint;
use com\openai\tools\Functions;
use com\openai\tools\{Tools, Functions};
use test\{Assert, Test, Values};
use webservices\rest\TestEndpoint;

Expand Down

0 comments on commit 8f16172

Please sign in to comment.