Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
juliuslipp committed Jan 5, 2024
0 parents commit 8b8fc3f
Show file tree
Hide file tree
Showing 59 changed files with 3,363 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
wwwroot/*.js
node_modules
typings
dist
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
README.md
25 changes: 25 additions & 0 deletions .openapi-generator-ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# OpenAPI Generator Ignore
# Generated by openapi-generator https://github.com/openapitools/openapi-generator

# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.

# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
#ApiClient.cs

# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux

# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux

# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md

src/runtime.ts
17 changes: 17 additions & 0 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.gitignore
.npmignore
.openapi-generator-ignore
README.md
package.json
src/apis/MixedbreadAiApi.ts
src/apis/index.ts
src/index.ts
src/models/Embeddings200Response.ts
src/models/Embeddings200ResponseDataInner.ts
src/models/Embeddings200ResponseUsage.ts
src/models/EmbeddingsRequest.ts
src/models/ErrorResponse.ts
src/models/index.ts
src/runtime.ts
tsconfig.esm.json
tsconfig.json
1 change: 1 addition & 0 deletions .openapi-generator/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7.2.0
46 changes: 46 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
## @mixedbread-ai/sdk@1.0.0

This generator creates TypeScript/JavaScript client that utilizes [Fetch API](https://fetch.spec.whatwg.org/). The generated Node module can be used in the following environments:

Environment
* Node.js
* Webpack
* Browserify

Language level
* ES5 - you must have a Promises/A+ library installed
* ES6

Module system
* CommonJS
* ES6 module system

It can be used in both TypeScript and JavaScript. In TypeScript, the definition should be automatically resolved via `package.json`. ([Reference](http://www.typescriptlang.org/docs/handbook/typings-for-npm-packages.html))

### Building

To build and compile the typescript sources to javascript use:
```
npm install
npm run build
```

### Publishing

First build the package then run ```npm publish```

### Consuming

navigate to the folder of your consuming project and run one of the following commands.

_published:_

```
npm install @mixedbread-ai/sdk@1.0.0 --save
```

_unPublished (not recommended):_

```
npm install PATH_TO_GENERATED_PACKAGE --save
# typescript-sdk
31 changes: 31 additions & 0 deletions dist/apis/MixedbreadAiApi.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/**
* mixedbread-ai
* Discover how to convert text into embeddings with the Embeddings API. Ideal for NLP tasks like text similarity and clustering. Use top open source models or your own fine-tuned models.
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import * as runtime from '../runtime';
import type { Embeddings200Response, EmbeddingsRequest } from '../models/index';
export interface EmbeddingsOperationRequest {
embeddingsRequest: EmbeddingsRequest;
}
/**
*
*/
export declare class MixedbreadAiApi extends runtime.BaseAPI {
/**
* This endpoint allows you to post text data and receive embeddings in response. The embeddings are generated using the model specified in the request body.
* Create embeddings
*/
embeddingsRaw(requestParameters: EmbeddingsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Embeddings200Response>>;
/**
* This endpoint allows you to post text data and receive embeddings in response. The embeddings are generated using the model specified in the request body.
* Create embeddings
*/
embeddings(embeddingsRequest: EmbeddingsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Embeddings200Response>;
}
68 changes: 68 additions & 0 deletions dist/apis/MixedbreadAiApi.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
"use strict";
/* tslint:disable */
/* eslint-disable */
/**
* mixedbread-ai
* Discover how to convert text into embeddings with the Embeddings API. Ideal for NLP tasks like text similarity and clustering. Use top open source models or your own fine-tuned models.
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.MixedbreadAiApi = void 0;
const runtime = require("../runtime");
const index_1 = require("../models/index");
/**
*
*/
class MixedbreadAiApi extends runtime.BaseAPI {
/**
* This endpoint allows you to post text data and receive embeddings in response. The embeddings are generated using the model specified in the request body.
* Create embeddings
*/
embeddingsRaw(requestParameters, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
if (requestParameters.embeddingsRequest === null || requestParameters.embeddingsRequest === undefined) {
throw new runtime.RequiredError('embeddingsRequest', 'Required parameter requestParameters.embeddingsRequest was null or undefined when calling embeddings.');
}
const queryParameters = {};
const headerParameters = {};
headerParameters['Content-Type'] = 'application/json';
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // MIXEDBREADAI_API_KEY authentication
}
const response = yield this.request({
path: `/v1/embeddings/`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: (0, index_1.EmbeddingsRequestToJSON)(requestParameters.embeddingsRequest),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.Embeddings200ResponseFromJSON)(jsonValue));
});
}
/**
* This endpoint allows you to post text data and receive embeddings in response. The embeddings are generated using the model specified in the request body.
* Create embeddings
*/
embeddings(embeddingsRequest, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
const response = yield this.embeddingsRaw({ embeddingsRequest: embeddingsRequest }, initOverrides);
return yield response.value();
});
}
}
exports.MixedbreadAiApi = MixedbreadAiApi;
1 change: 1 addition & 0 deletions dist/apis/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './MixedbreadAiApi';
19 changes: 19 additions & 0 deletions dist/apis/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
/* tslint:disable */
/* eslint-disable */
__exportStar(require("./MixedbreadAiApi"), exports);
31 changes: 31 additions & 0 deletions dist/esm/apis/MixedbreadAiApi.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/**
* mixedbread-ai
* Discover how to convert text into embeddings with the Embeddings API. Ideal for NLP tasks like text similarity and clustering. Use top open source models or your own fine-tuned models.
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import * as runtime from '../runtime';
import type { Embeddings200Response, EmbeddingsRequest } from '../models/index';
export interface EmbeddingsOperationRequest {
embeddingsRequest: EmbeddingsRequest;
}
/**
*
*/
export declare class MixedbreadAiApi extends runtime.BaseAPI {
/**
* This endpoint allows you to post text data and receive embeddings in response. The embeddings are generated using the model specified in the request body.
* Create embeddings
*/
embeddingsRaw(requestParameters: EmbeddingsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Embeddings200Response>>;
/**
* This endpoint allows you to post text data and receive embeddings in response. The embeddings are generated using the model specified in the request body.
* Create embeddings
*/
embeddings(embeddingsRequest: EmbeddingsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Embeddings200Response>;
}
64 changes: 64 additions & 0 deletions dist/esm/apis/MixedbreadAiApi.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/* tslint:disable */
/* eslint-disable */
/**
* mixedbread-ai
* Discover how to convert text into embeddings with the Embeddings API. Ideal for NLP tasks like text similarity and clustering. Use top open source models or your own fine-tuned models.
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
import * as runtime from '../runtime';
import { Embeddings200ResponseFromJSON, EmbeddingsRequestToJSON, } from '../models/index';
/**
*
*/
export class MixedbreadAiApi extends runtime.BaseAPI {
/**
* This endpoint allows you to post text data and receive embeddings in response. The embeddings are generated using the model specified in the request body.
* Create embeddings
*/
embeddingsRaw(requestParameters, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
if (requestParameters.embeddingsRequest === null || requestParameters.embeddingsRequest === undefined) {
throw new runtime.RequiredError('embeddingsRequest', 'Required parameter requestParameters.embeddingsRequest was null or undefined when calling embeddings.');
}
const queryParameters = {};
const headerParameters = {};
headerParameters['Content-Type'] = 'application/json';
if (this.configuration && this.configuration.apiKey) {
headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // MIXEDBREADAI_API_KEY authentication
}
const response = yield this.request({
path: `/v1/embeddings/`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: EmbeddingsRequestToJSON(requestParameters.embeddingsRequest),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => Embeddings200ResponseFromJSON(jsonValue));
});
}
/**
* This endpoint allows you to post text data and receive embeddings in response. The embeddings are generated using the model specified in the request body.
* Create embeddings
*/
embeddings(embeddingsRequest, initOverrides) {
return __awaiter(this, void 0, void 0, function* () {
const response = yield this.embeddingsRaw({ embeddingsRequest: embeddingsRequest }, initOverrides);
return yield response.value();
});
}
}
1 change: 1 addition & 0 deletions dist/esm/apis/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './MixedbreadAiApi';
3 changes: 3 additions & 0 deletions dist/esm/apis/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/* tslint:disable */
/* eslint-disable */
export * from './MixedbreadAiApi';
3 changes: 3 additions & 0 deletions dist/esm/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export * from './runtime';
export * from './apis/index';
export * from './models/index';
5 changes: 5 additions & 0 deletions dist/esm/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/* tslint:disable */
/* eslint-disable */
export * from './runtime';
export * from './apis/index';
export * from './models/index';
45 changes: 45 additions & 0 deletions dist/esm/models/Embeddings200Response.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/**
* mixedbread-ai
* Discover how to convert text into embeddings with the Embeddings API. Ideal for NLP tasks like text similarity and clustering. Use top open source models or your own fine-tuned models.
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import type { Embeddings200ResponseDataInner } from './Embeddings200ResponseDataInner';
import type { Embeddings200ResponseUsage } from './Embeddings200ResponseUsage';
/**
*
* @export
* @interface Embeddings200Response
*/
export interface Embeddings200Response {
/**
* The embeddings model used.
* @type {string}
* @memberof Embeddings200Response
*/
model: string;
/**
*
* @type {Array<Embeddings200ResponseDataInner>}
* @memberof Embeddings200Response
*/
data: Array<Embeddings200ResponseDataInner>;
/**
*
* @type {Embeddings200ResponseUsage}
* @memberof Embeddings200Response
*/
usage: Embeddings200ResponseUsage;
}
/**
* Check if a given object implements the Embeddings200Response interface.
*/
export declare function instanceOfEmbeddings200Response(value: object): boolean;
export declare function Embeddings200ResponseFromJSON(json: any): Embeddings200Response;
export declare function Embeddings200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): Embeddings200Response;
export declare function Embeddings200ResponseToJSON(value?: Embeddings200Response | null): any;
Loading

0 comments on commit 8b8fc3f

Please sign in to comment.