-
-
Notifications
You must be signed in to change notification settings - Fork 550
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #405 from openai-php/add-assistants-v2-api
Implement vector store endpoints and add assistants API v2 support
- Loading branch information
Showing
160 changed files
with
3,922 additions
and
1,456 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<?php | ||
|
||
namespace OpenAI\Contracts\Resources; | ||
|
||
use OpenAI\Responses\VectorStores\VectorStoreDeleteResponse; | ||
use OpenAI\Responses\VectorStores\VectorStoreListResponse; | ||
use OpenAI\Responses\VectorStores\VectorStoreResponse; | ||
|
||
interface VectorStoresContract | ||
{ | ||
/** | ||
* Create a vector store | ||
* | ||
* @see https://platform.openai.com/docs/api-reference/vector-stores/create | ||
* | ||
* @param array<string, mixed> $parameters | ||
*/ | ||
public function create(array $parameters): VectorStoreResponse; | ||
|
||
/** | ||
* Returns a list of vector stores. | ||
* | ||
* @see https://platform.openai.com/docs/api-reference/vector-stores/list | ||
*/ | ||
public function list(): VectorStoreListResponse; | ||
|
||
/** | ||
* Retrieves a vector store. | ||
* | ||
* @see https://platform.openai.com/docs/api-reference/vector-stores/retrieve | ||
*/ | ||
public function retrieve(string $vectorStore): VectorStoreResponse; | ||
|
||
/** | ||
* Modify a vector store | ||
* | ||
* @see https://platform.openai.com/docs/api-reference/vector-stores/modify | ||
* | ||
* @param array<string, mixed> $parameters | ||
*/ | ||
public function modify(string $vectorStore, array $parameters): VectorStoreResponse; | ||
|
||
/** | ||
* Delete a vector store. | ||
* | ||
* https://platform.openai.com/docs/api-reference/vector-stores/delete | ||
*/ | ||
public function delete(string $vectorStore): VectorStoreDeleteResponse; | ||
|
||
/** | ||
* Manage the files related to the vector store | ||
* | ||
* @see https://platform.openai.com/docs/api-reference/vector-stores-files | ||
*/ | ||
public function files(): VectorStoresFilesContract; | ||
|
||
/** | ||
* Manage the file batches related to the vector store | ||
* | ||
* @see https://platform.openai.com/docs/api-reference/vector-stores-file-batches | ||
*/ | ||
public function batches(): VectorStoresFileBatchesContract; | ||
} |
39 changes: 39 additions & 0 deletions
39
src/Contracts/Resources/VectorStoresFileBatchesContract.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
|
||
namespace OpenAI\Contracts\Resources; | ||
|
||
use OpenAI\Responses\VectorStores\FileBatches\VectorStoreFileBatchResponse; | ||
use OpenAI\Responses\VectorStores\Files\VectorStoreFileListResponse; | ||
|
||
interface VectorStoresFileBatchesContract | ||
{ | ||
/** | ||
* Create a file batch on a vector store | ||
* | ||
* @see https://platform.openai.com/docs/api-reference/vector-stores-file-batches/createBatch | ||
* | ||
* @param array<string, mixed> $parameters | ||
*/ | ||
public function create(string $vectorStoreId, array $parameters): VectorStoreFileBatchResponse; | ||
|
||
/** | ||
* Retrieves a file batch within a vector store. | ||
* | ||
* @see https://platform.openai.com/docs/api-reference/vector-stores-file-batches/getBatch | ||
*/ | ||
public function retrieve(string $vectorStoreId, string $fileBatchId): VectorStoreFileBatchResponse; | ||
|
||
/** | ||
* Cancel a vector store file batch | ||
* | ||
* @see https://platform.openai.com/docs/api-reference/vector-stores-file-batches/cancelBatch | ||
*/ | ||
public function cancel(string $vectorStoreId, string $fileBatchId): VectorStoreFileBatchResponse; | ||
|
||
/** | ||
* Lists the files within a file batch within a vector store | ||
* | ||
* @see https://platform.openai.com/docs/api-reference/vector-stores-file-batches/listBatchFiles | ||
*/ | ||
public function listFiles(string $vectorStoreId, string $fileBatchId): VectorStoreFileListResponse; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
|
||
namespace OpenAI\Contracts\Resources; | ||
|
||
use OpenAI\Responses\VectorStores\Files\VectorStoreFileDeleteResponse; | ||
use OpenAI\Responses\VectorStores\Files\VectorStoreFileListResponse; | ||
use OpenAI\Responses\VectorStores\Files\VectorStoreFileResponse; | ||
|
||
interface VectorStoresFilesContract | ||
{ | ||
/** | ||
* Create a file on a vector store | ||
* | ||
* @see https://platform.openai.com/docs/api-reference/vector-stores-files/createFile | ||
* | ||
* @param array<string, mixed> $parameters | ||
*/ | ||
public function create(string $vectorStoreId, array $parameters): VectorStoreFileResponse; | ||
|
||
/** | ||
* Returns a list of files within a vector store. | ||
* | ||
* @see https://platform.openai.com/docs/api-reference/vector-stores-files/listFiles | ||
*/ | ||
public function list(string $vectorStoreId): VectorStoreFileListResponse; | ||
|
||
/** | ||
* Retrieves a file within a vector store. | ||
* | ||
* @see https://platform.openai.com/docs/api-reference/vector-stores-files/getFile | ||
*/ | ||
public function retrieve(string $vectorStoreId, string $fileId): VectorStoreFileResponse; | ||
|
||
/** | ||
* Delete a file within a vector store. | ||
* | ||
* https://platform.openai.com/docs/api-reference/vector-stores/delete | ||
*/ | ||
public function delete(string $vectorStoreId, string $fileId): VectorStoreFileDeleteResponse; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.