Skip to content

Commit

Permalink
Client generation using the latest openapi_spec package
Browse files Browse the repository at this point in the history
  • Loading branch information
walsha2 committed Aug 31, 2023
1 parent 1bbb2b9 commit 6facc31
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 19 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 0.5.2

* Client generation using latest `openapi_spec` package (v0.5.3)

## 0.5.1

* Remove trailing slash from /databases endpoint
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ Yes! This package is used in production applications and is actively maintained!

For detailed API information, please see the official [Pinecone API reference](https://docs.pinecone.io/reference). This package is a thin wrapper around the official API and aims to have full parity with the official API.

This Dart client was generated using the [openapi_spec](https://pub.dev/packages/openapi_spec) package by mirroring the implementation details defined in the [Pinecone API](https://docs.pinecone.io/reference).

## Client Instance

To create a client instance you simply need the API key for your Pinecone project. You can find your API key in the [Pinecone console](https://app.pinecone.io/).
Expand Down
18 changes: 1 addition & 17 deletions lib/src/generated/client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ class PineconeClient {
Future<http.Response> _request({
required String host,
required String path,
required bool? secure,
required HttpMethod method,
Map<String, dynamic> queryParams = const {},
Map<String, String> headerParams = const {},
Expand Down Expand Up @@ -151,7 +150,7 @@ class PineconeClient {
});

// Build the request URI
secure ??= Uri.parse(host).scheme == 'https';
final secure = Uri.parse(host).scheme == 'https';
Uri uri;
String authority;
if (host.contains('http')) {
Expand Down Expand Up @@ -271,7 +270,6 @@ class PineconeClient {
final r = await _request(
host: 'controller.${environment}.pinecone.io',
path: '/collections',
secure: true,
method: HttpMethod.get,
isMultipart: false,
requestType: '',
Expand Down Expand Up @@ -303,7 +301,6 @@ class PineconeClient {
final _ = await _request(
host: 'controller.${environment}.pinecone.io',
path: '/collections',
secure: true,
method: HttpMethod.post,
isMultipart: false,
requestType: 'application/json',
Expand Down Expand Up @@ -335,7 +332,6 @@ class PineconeClient {
final r = await _request(
host: 'controller.${environment}.pinecone.io',
path: '/collections/$collectionName',
secure: true,
method: HttpMethod.get,
isMultipart: false,
requestType: '',
Expand Down Expand Up @@ -367,7 +363,6 @@ class PineconeClient {
final _ = await _request(
host: 'controller.${environment}.pinecone.io',
path: '/collections/$collectionName',
secure: true,
method: HttpMethod.delete,
isMultipart: false,
requestType: '',
Expand Down Expand Up @@ -395,7 +390,6 @@ class PineconeClient {
final r = await _request(
host: 'controller.${environment}.pinecone.io',
path: '/databases',
secure: true,
method: HttpMethod.get,
isMultipart: false,
requestType: '',
Expand Down Expand Up @@ -427,7 +421,6 @@ class PineconeClient {
final _ = await _request(
host: 'controller.${environment}.pinecone.io',
path: '/databases',
secure: true,
method: HttpMethod.post,
isMultipart: false,
requestType: 'application/json',
Expand Down Expand Up @@ -459,7 +452,6 @@ class PineconeClient {
final r = await _request(
host: 'controller.${environment}.pinecone.io',
path: '/databases/$indexName',
secure: true,
method: HttpMethod.get,
isMultipart: false,
requestType: '',
Expand Down Expand Up @@ -491,7 +483,6 @@ class PineconeClient {
final _ = await _request(
host: 'controller.${environment}.pinecone.io',
path: '/databases/$indexName',
secure: true,
method: HttpMethod.delete,
isMultipart: false,
requestType: '',
Expand Down Expand Up @@ -525,7 +516,6 @@ class PineconeClient {
final _ = await _request(
host: 'controller.${environment}.pinecone.io',
path: '/databases/$indexName',
secure: true,
method: HttpMethod.patch,
isMultipart: false,
requestType: 'application/json',
Expand Down Expand Up @@ -563,7 +553,6 @@ class PineconeClient {
final r = await _request(
host: '${indexName}-${projectId}.svc.${environment}.pinecone.io',
path: '/describe_index_stats',
secure: true,
method: HttpMethod.post,
isMultipart: false,
requestType: 'application/json',
Expand Down Expand Up @@ -602,7 +591,6 @@ class PineconeClient {
final r = await _request(
host: '${indexName}-${projectId}.svc.${environment}.pinecone.io',
path: '/query',
secure: true,
method: HttpMethod.post,
isMultipart: false,
requestType: 'application/json',
Expand Down Expand Up @@ -641,7 +629,6 @@ class PineconeClient {
final _ = await _request(
host: '${indexName}-${projectId}.svc.${environment}.pinecone.io',
path: '/vectors/delete',
secure: true,
method: HttpMethod.post,
isMultipart: false,
requestType: 'application/json',
Expand Down Expand Up @@ -682,7 +669,6 @@ class PineconeClient {
final r = await _request(
host: '${indexName}-${projectId}.svc.${environment}.pinecone.io',
path: '/vectors/fetch',
secure: true,
method: HttpMethod.get,
isMultipart: false,
requestType: '',
Expand Down Expand Up @@ -724,7 +710,6 @@ class PineconeClient {
final _ = await _request(
host: '${indexName}-${projectId}.svc.${environment}.pinecone.io',
path: '/vectors/update',
secure: true,
method: HttpMethod.post,
isMultipart: false,
requestType: 'application/json',
Expand Down Expand Up @@ -762,7 +747,6 @@ class PineconeClient {
final r = await _request(
host: '${indexName}-${projectId}.svc.${environment}.pinecone.io',
path: '/vectors/upsert',
secure: true,
method: HttpMethod.post,
isMultipart: false,
requestType: 'application/json',
Expand Down
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: pinecone
description: Unofficial Dart client for Pinecone vector database. For more details on Pinecone, please visit https://docs.pinecone.io/docs/overview.
version: 0.5.1
version: 0.5.2
maintainer: Taza Technology LLC
repository: https://github.com/tazatechnology/pinecone
issue_tracker: https://github.com/tazatechnology/pinecone/issues
Expand All @@ -16,7 +16,7 @@ dependencies:
json_annotation: ^4.8.1

dev_dependencies:
openapi_spec: ^0.5.0
openapi_spec: ^0.5.3
build_runner: ^2.4.6
lints: ^2.1.1
freezed: ^2.4.2
Expand Down

0 comments on commit 6facc31

Please sign in to comment.