Skip to content

Commit

Permalink
Update frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
ngrislain committed Oct 16, 2024
1 parent 749961b commit d4d9abb
Show file tree
Hide file tree
Showing 25 changed files with 175 additions and 25 deletions.
8 changes: 6 additions & 2 deletions frontend/src/client/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,13 @@ export type { EventUpdate } from './models/EventUpdate';
export type { Function } from './models/Function';
export type { FunctionDefinition } from './models/FunctionDefinition';
export type { HTTPValidationError } from './models/HTTPValidationError';
export type { JSONSchema } from './models/JSONSchema';
export type { LMConfig } from './models/LMConfig';
export type { Message_Input } from './models/Message_Input';
export type { Metadata } from './models/Metadata';
export type { NewPassword } from './models/NewPassword';
export type { ResponseFormat } from './models/ResponseFormat';
export type { ResponseFormatBase } from './models/ResponseFormatBase';
export type { ResponseFormatJSONSchema } from './models/ResponseFormatJSONSchema';
export type { Score } from './models/Score';
export type { SettingCreate } from './models/SettingCreate';
export type { SettingOut } from './models/SettingOut';
Expand Down Expand Up @@ -121,11 +123,13 @@ export { $EventUpdate } from './schemas/$EventUpdate';
export { $Function } from './schemas/$Function';
export { $FunctionDefinition } from './schemas/$FunctionDefinition';
export { $HTTPValidationError } from './schemas/$HTTPValidationError';
export { $JSONSchema } from './schemas/$JSONSchema';
export { $LMConfig } from './schemas/$LMConfig';
export { $Message_Input } from './schemas/$Message_Input';
export { $Metadata } from './schemas/$Metadata';
export { $NewPassword } from './schemas/$NewPassword';
export { $ResponseFormat } from './schemas/$ResponseFormat';
export { $ResponseFormatBase } from './schemas/$ResponseFormatBase';
export { $ResponseFormatJSONSchema } from './schemas/$ResponseFormatJSONSchema';
export { $Score } from './schemas/$Score';
export { $SettingCreate } from './schemas/$SettingCreate';
export { $SettingOut } from './schemas/$SettingOut';
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/client/models/DocumentDataExampleCreate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

export type DocumentDataExampleCreate = {
document_id: string;
data: string;
data: Record<string, (string | null)>;
document_data_extractor_id?: (number | null);
start_page?: number;
end_page?: (number | null);
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/client/models/DocumentDataExampleUpdate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

export type DocumentDataExampleUpdate = {
document_id?: (string | null);
data?: (string | null);
data?: (Record<string, (string | null)> | null);
document_data_extractor_id?: (number | null);
start_page?: (number | null);
end_page?: (number | null);
Expand Down
1 change: 1 addition & 0 deletions frontend/src/client/models/DocumentDataExtractorCreate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
export type DocumentDataExtractorCreate = {
name: string;
prompt: string;
response_template: Record<string, any[]>;
};

1 change: 1 addition & 0 deletions frontend/src/client/models/DocumentDataExtractorOut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ export type DocumentDataExtractorOut = {
timestamp: string;
owner_id: number;
document_data_examples: Array<DocumentDataExample>;
response_template: string;
};

1 change: 1 addition & 0 deletions frontend/src/client/models/DocumentDataExtractorUpdate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
export type DocumentDataExtractorUpdate = {
name?: (string | null);
prompt?: (string | null);
response_template?: (Record<string, any[]> | null);
};

11 changes: 11 additions & 0 deletions frontend/src/client/models/JSONSchema.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/* generated using openapi-typescript-codegen -- do no edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */

export type JSONSchema = {
name: string;
schema?: Record<string, any>;
strict?: (boolean | null);
};

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/* tslint:disable */
/* eslint-disable */

export type ResponseFormat = {
export type ResponseFormatBase = {
type?: ('text' | 'json_object' | null);
};

12 changes: 12 additions & 0 deletions frontend/src/client/models/ResponseFormatJSONSchema.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/* generated using openapi-typescript-codegen -- do no edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */

import type { JSONSchema } from './JSONSchema';

export type ResponseFormatJSONSchema = {
json_schema: JSONSchema;
type: 'json_schema';
};

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
import type { ChatCompletionToolParam } from './ChatCompletionToolParam';
import type { LMConfig } from './LMConfig';
import type { Message_Input } from './Message_Input';
import type { ResponseFormat } from './ResponseFormat';
import type { ResponseFormatBase } from './ResponseFormatBase';
import type { ResponseFormatJSONSchema } from './ResponseFormatJSONSchema';

/**
* Maps to:
Expand All @@ -24,7 +25,7 @@ export type app__lm__models__chat_completion__ChatCompletionRequest = {
max_tokens?: (number | null);
'n'?: (number | null);
presence_penalty?: (number | null);
response_format?: (ResponseFormat | null);
response_format?: (ResponseFormatJSONSchema | ResponseFormatBase | null);
safe_prompt?: (boolean | null);
seed?: (number | null);
stop?: (string | Array<string> | null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import type { ChatCompletionToolParam } from './ChatCompletionToolParam';
import type { Message_Input } from './Message_Input';
import type { ResponseFormat } from './ResponseFormat';
import type { ResponseFormatBase } from './ResponseFormatBase';

/**
* Maps to:
Expand All @@ -17,7 +17,7 @@ export type app__lm__models__mistral__ChatCompletionRequest = {
messages: Array<Message_Input>;
model: (string | 'mistral-large-latest' | 'mistral-medium' | 'mistral-medium-latest' | 'mistral-small' | 'mistral-small-latest' | 'mistral-tiny' | 'open-mistral-7b' | 'open-mixtral-8x7b');
max_tokens?: (number | null);
response_format?: (ResponseFormat | null);
response_format?: (ResponseFormatBase | null);
safe_prompt?: (boolean | null);
random_seed?: (number | null);
temperature?: (number | null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
import type { ChatCompletionToolParam } from './ChatCompletionToolParam';
import type { LMConfig } from './LMConfig';
import type { Message_Input } from './Message_Input';
import type { ResponseFormat } from './ResponseFormat';
import type { ResponseFormatBase } from './ResponseFormatBase';
import type { ResponseFormatJSONSchema } from './ResponseFormatJSONSchema';

/**
* https://github.com/openai/openai-python/blob/main/src/openai/types/chat/completion_create_params.py#L24
Expand All @@ -21,7 +22,7 @@ export type app__lm__models__openai__ChatCompletionRequest = {
max_tokens?: (number | null);
'n'?: (number | null);
presence_penalty?: (number | null);
response_format?: (ResponseFormat | null);
response_format?: (ResponseFormatJSONSchema | ResponseFormatBase | null);
safe_prompt?: (boolean | null);
seed?: (number | null);
stop?: (string | Array<string> | null);
Expand Down
10 changes: 9 additions & 1 deletion frontend/src/client/schemas/$DocumentDataExampleCreate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,15 @@ export const $DocumentDataExampleCreate = {
isRequired: true,
},
data: {
type: 'string',
type: 'dictionary',
contains: {
type: 'any-of',
contains: [{
type: 'string',
}, {
type: 'null',
}],
},
isRequired: true,
},
document_data_extractor_id: {
Expand Down
10 changes: 9 additions & 1 deletion frontend/src/client/schemas/$DocumentDataExampleUpdate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,15 @@ export const $DocumentDataExampleUpdate = {
data: {
type: 'any-of',
contains: [{
type: 'string',
type: 'dictionary',
contains: {
type: 'any-of',
contains: [{
type: 'string',
}, {
type: 'null',
}],
},
}, {
type: 'null',
}],
Expand Down
9 changes: 9 additions & 0 deletions frontend/src/client/schemas/$DocumentDataExtractorCreate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,14 @@ export const $DocumentDataExtractorCreate = {
type: 'string',
isRequired: true,
},
response_template: {
type: 'dictionary',
contains: {
type: 'any[]',
maxItems: 2,
minItems: 2,
},
isRequired: true,
},
},
} as const;
4 changes: 4 additions & 0 deletions frontend/src/client/schemas/$DocumentDataExtractorOut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,9 @@ export const $DocumentDataExtractorOut = {
},
isRequired: true,
},
response_template: {
type: 'string',
isRequired: true,
},
},
} as const;
13 changes: 13 additions & 0 deletions frontend/src/client/schemas/$DocumentDataExtractorUpdate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,18 @@ export const $DocumentDataExtractorUpdate = {
type: 'null',
}],
},
response_template: {
type: 'any-of',
contains: [{
type: 'dictionary',
contains: {
type: 'any[]',
maxItems: 2,
minItems: 2,
},
}, {
type: 'null',
}],
},
},
} as const;
27 changes: 27 additions & 0 deletions frontend/src/client/schemas/$JSONSchema.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/* generated using openapi-typescript-codegen -- do no edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export const $JSONSchema = {
properties: {
name: {
type: 'string',
isRequired: true,
},
schema: {
type: 'dictionary',
contains: {
properties: {
},
},
},
strict: {
type: 'any-of',
contains: [{
type: 'boolean',
}, {
type: 'null',
}],
},
},
} as const;
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export const $ResponseFormat = {
export const $ResponseFormatBase = {
properties: {
type: {
type: 'any-of',
Expand Down
16 changes: 16 additions & 0 deletions frontend/src/client/schemas/$ResponseFormatJSONSchema.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/* generated using openapi-typescript-codegen -- do no edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export const $ResponseFormatJSONSchema = {
properties: {
json_schema: {
type: 'JSONSchema',
isRequired: true,
},
type: {
type: 'Enum',
isRequired: true,
},
},
} as const;
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ export const $app__lm__models__chat_completion__ChatCompletionRequest = {
response_format: {
type: 'any-of',
contains: [{
type: 'ResponseFormat',
type: 'ResponseFormatJSONSchema',
}, {
type: 'ResponseFormatBase',
}, {
type: 'null',
}],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const $app__lm__models__mistral__ChatCompletionRequest = {
response_format: {
type: 'any-of',
contains: [{
type: 'ResponseFormat',
type: 'ResponseFormatBase',
}, {
type: 'null',
}],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ export const $app__lm__models__openai__ChatCompletionRequest = {
response_format: {
type: 'any-of',
contains: [{
type: 'ResponseFormat',
type: 'ResponseFormatJSONSchema',
}, {
type: 'ResponseFormatBase',
}, {
type: 'null',
}],
Expand Down
24 changes: 24 additions & 0 deletions frontend/src/client/services/DocumentsService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { app__models__Message } from '../models/app__models__Message';
import type { Body_documents_create_file } from '../models/Body_documents_create_file';
import type { Document } from '../models/Document';
import type { Documents } from '../models/Documents';
Expand Down Expand Up @@ -67,6 +68,29 @@ export class DocumentsService {
});
}

/**
* Delete File
* Delete a file.
* @returns app__models__Message Successful Response
* @throws ApiError
*/
public static deleteFile({
name,
}: {
name: string,
}): CancelablePromise<app__models__Message> {
return __request(OpenAPI, {
method: 'DELETE',
url: '/api/v1/documents/{name}',
path: {
'name': name,
},
errors: {
422: `Validation Error`,
},
});
}

/**
* Read File As Text
* @returns string Successful Response
Expand Down
Loading

0 comments on commit d4d9abb

Please sign in to comment.