semanticwrap / semanticwrap
此包已废弃,不再维护。未建议替代包。
回答有关您的数据的任何查询
2.0.5
2023-09-27 14:54 UTC
Requires
- php: ^7.4 || ^8.0
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^7.3
- guzzlehttp/psr7: ^1.7 || ^2.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.5
- phpunit/phpunit: ^8.0 || ^9.0
README
OpenAPIClient-php
回答有关您的数据的任何查询
安装与使用
要求
PHP 7.4 及以上版本。也应适用于 PHP 8.0。
Composer
要通过 Composer 安装绑定,请在 composer.json
中添加以下内容
{ "repositories": [ { "type": "vcs", "url": "https://github.com/semanticwrap/semanticwrap-php-client.git" } ], "require": { "semanticwrap/semanticwrap-php-client": "*@dev" } }
然后运行 composer install
手动安装
下载文件并包含 autoload.php
<?php require_once('/path/to/OpenAPIClient-php/vendor/autoload.php');
入门指南
请遵循 安装过程,然后运行以下命令
<?php require_once(__DIR__ . '/vendor/autoload.php'); $apiInstance = new Semanticwrap\Api\AugmentationApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client() ); $index_name = 'index_name_example'; // string $payload = new \Semanticwrap\Model\CompletionQuery(); // \Semanticwrap\Model\CompletionQuery $error_on_empty_docs = 'error_on_empty_docs_example'; // string | If true, will return 400 error if no docs are found $with_source = 'with_source_example'; // string | If true, the source of the answer is returned try { $result = $apiInstance->asyncAugment($index_name, $payload, $error_on_empty_docs, $with_source); print_r($result); } catch (Exception $e) { echo 'Exception when calling AugmentationApi->asyncAugment: ', $e->getMessage(), PHP_EOL; }
API 端点
所有 URI 都相对于 /api/v2
类 | 方法 | HTTP 请求 | 描述 |
---|---|---|---|
AugmentationApi | asyncAugment | POST /augmentation/async/augment/{index_name} | 从索引中的文档回答给定的查询 |
AugmentationApi | augment | POST /augmentation/augment/{index_name} | 从索引中的文档回答给定的查询 |
AugmentationApi | augmentByUrls | POST /augmentation/complex-chain/urls | 从索引中的文档回答给定的查询 |
AugmentationApi | chatAugment | POST /augmentation/chat/augment/{index_name} | 从索引中的文档回答给定的查询 |
AugmentationApi | complexAugment | POST /augmentation/complex-chain/docs | 从索引中的文档回答给定的查询 |
DocumentsApi | deleteDocument | DELETE /doc/{index_name}/{doc_id} | 删除文档 |
DocumentsApi | deleteDocumentByQuery | POST /doc/delete_by_query/{index_name} | 通过查询删除文档 |
DocumentsApi | getDocument | GET /doc/{index_name}/{doc_id} | 获取文档 |
DocumentsApi | getDocumentByQuery | POST /doc/{index_name} | 通过查询获取文档 |
DocumentsApi | updateDocumentByQuery | POST /doc/_update_by_query/{index_name} | 通过查询更新文档 |
FineTunedApi | listFineTunedModel | POST /fine_tuned/ | 获取微调模型 |
FineTunedApi | memorylessAugmentV2 | POST /fine_tuned/memoryless/augment | 从索引中的文档回答给定的查询 |
IndexApi | createIndex | PUT /index/_mapping/{index_name} | 如果不存在,则创建新索引 |
IndexApi | indexDocuments | POST /index/bulk/{index_name} | 将新文档添加到索引 |
ProcessApi | getAsyncProcessResult | GET /async_process/{process_id} | 获取异步处理的结果 |
SearchApi | search | POST /search/{index_name} | 使用 ANN 搜索从索引中获取相关文档 |
SearchApi | searchByVector | POST /search/vector/{index_name} | 使用 ANN 搜索从索引中获取相关文档 |
SearchApi | searchDocsById | POST /search/{index_name}/{doc_id} | 对于给定的文档 ID,使用 ANN 搜索从索引中获取相关文档 |
VideoApi | getYoutubeTranscript | POST /video/youtube_transcript/{video_id} | 获取视频字幕 |
模型
- AIModel
- Ack
- AsyncProcessResponse
- AugmentationQueryV2
- AuthSecurity
- BulkIndex
- ChatCompletionQuery
- CompletionQuery
- CompletionQueryFilter
- CompletionQueryModel
- CompletionQueryPrompt
- CompletionResponse
- CompletionResponseResult
- CompletionResponseTiming
- ComplexAugmentationWithDocs
- DocsSearch
- DocsSearchFilter
- Document
- DocumentNonQuery
- DocumentQuery
- DocumentQueryByVector
- DocumentQueryFilter
- DocumentQueryModel
- Error
- IndexMapping
- IndexMappingModel
- IndexResponse
- IndexResponseTiming
- LlmBulkResponse
- LlmBulkResponseTiming
- LlmResponse
- PromptTemplateModel
- QueryFilter
- RelatedDocs
- SWAIFineTunedModel
- 搜索响应
- 时间模型
- 更新文档
- UrlCrawlingAugmentationQuery
- YouTubeMicrodataRequestModel
- YouTubeTranscriptResponseModel
授权
所有端点均不需要授权。
测试
要运行测试,请使用
composer install vendor/bin/phpunit
作者
关于此包
此PHP包由OpenAPI Generator项目自动生成
- API版本:
2.0
- 包版本:
2.0.5
- 包版本:
- 构建包:
org.openapitools.codegen.languages.PhpClientCodegen