更新 swagger

This commit is contained in:
ivamp 2024-08-17 17:30:39 +08:00
parent 05ef481f0a
commit 6ac7af786d
2 changed files with 239 additions and 166 deletions

View File

@ -132,10 +132,19 @@ definitions:
type: string type: string
message: message:
type: string type: string
role:
enum:
- user
- user_hide
- system
- system_hide
- assistant
type: string
required: required:
- assistant_token - assistant_token
- guest_id - guest_id
- message - message
- role
type: object type: object
rag-new_internal_schema.AssistantCreateRequest: rag-new_internal_schema.AssistantCreateRequest:
properties: properties:
@ -190,11 +199,22 @@ definitions:
message: message:
maxLength: 255 maxLength: 255
type: string type: string
role:
enum:
- user
- user_hide
- system
- system_hide
- assistant
type: string
required: required:
- message - message
- role
type: object type: object
rag-new_internal_schema.ChatMessageResponse: rag-new_internal_schema.ChatMessageResponse:
properties: properties:
stream:
type: boolean
stream_id: stream_id:
type: string type: string
type: object type: object
@ -421,6 +441,11 @@ paths:
- application/json - application/json
description: 兼容 OpenAI Chat Completion 接口,认证需要使用 Assistant Share Token description: 兼容 OpenAI Chat Completion 接口,认证需要使用 Assistant Share Token
parameters: parameters:
- description: 指定聊天中的用户 IP 地址,不指定则自动获取。此 IP 地址只会增加至 Prompt 中,如果不希望增加,请关闭系统自带
Prompt 选项
in: header
name: X-User-IP
type: string
- description: Chat - description: Chat
in: body in: body
name: chat name: chat
@ -1254,6 +1279,11 @@ paths:
- application/json - application/json
description: get string by ID description: get string by ID
parameters: parameters:
- description: 指定聊天中的用户 IP 地址,不指定则自动获取。此 IP 地址只会增加至 Prompt 中,如果不希望增加,请关闭系统自带
Prompt 选项
in: header
name: X-User-IP
type: string
- description: Chat ID - description: Chat ID
in: path in: path
name: id name: id

View File

@ -23,6 +23,37 @@ import type { RequestArgs } from './base';
// @ts-ignore // @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError, operationServerMap } from './base'; import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError, operationServerMap } from './base';
/**
*
* @export
* @interface ApiOpenaiCompatibleV1ChatCompletionsPost200Response
*/
export interface ApiOpenaiCompatibleV1ChatCompletionsPost200Response {
/**
*
* @type {RagNewInternalSchemaOpenAIChatCompletionResponse}
* @memberof ApiOpenaiCompatibleV1ChatCompletionsPost200Response
*/
'data'?: RagNewInternalSchemaOpenAIChatCompletionResponse;
/**
*
* @type {string}
* @memberof ApiOpenaiCompatibleV1ChatCompletionsPost200Response
*/
'error'?: string;
/**
*
* @type {string}
* @memberof ApiOpenaiCompatibleV1ChatCompletionsPost200Response
*/
'message'?: string;
/**
*
* @type {boolean}
* @memberof ApiOpenaiCompatibleV1ChatCompletionsPost200Response
*/
'success'?: boolean;
}
/** /**
* *
* @export * @export
@ -333,37 +364,6 @@ export interface ApiV1ChatPublicPost200Response {
*/ */
'success'?: boolean; 'success'?: boolean;
} }
/**
*
* @export
* @interface ApiV1OpenaiCompatibleCompletionPost200Response
*/
export interface ApiV1OpenaiCompatibleCompletionPost200Response {
/**
*
* @type {RagNewInternalSchemaOpenAIChatCompletionResponse}
* @memberof ApiV1OpenaiCompatibleCompletionPost200Response
*/
'data'?: RagNewInternalSchemaOpenAIChatCompletionResponse;
/**
*
* @type {string}
* @memberof ApiV1OpenaiCompatibleCompletionPost200Response
*/
'error'?: string;
/**
*
* @type {string}
* @memberof ApiV1OpenaiCompatibleCompletionPost200Response
*/
'message'?: string;
/**
*
* @type {boolean}
* @memberof ApiV1OpenaiCompatibleCompletionPost200Response
*/
'success'?: boolean;
}
/** /**
* *
* @export * @export
@ -842,7 +842,24 @@ export interface RagNewInternalSchemaAddPublicChatMessageRequest {
* @memberof RagNewInternalSchemaAddPublicChatMessageRequest * @memberof RagNewInternalSchemaAddPublicChatMessageRequest
*/ */
'message': string; 'message': string;
/**
*
* @type {string}
* @memberof RagNewInternalSchemaAddPublicChatMessageRequest
*/
'role': RagNewInternalSchemaAddPublicChatMessageRequestRoleEnum;
} }
export const RagNewInternalSchemaAddPublicChatMessageRequestRoleEnum = {
User: 'user',
UserHide: 'user_hide',
System: 'system',
SystemHide: 'system_hide',
Assistant: 'assistant'
} as const;
export type RagNewInternalSchemaAddPublicChatMessageRequestRoleEnum = typeof RagNewInternalSchemaAddPublicChatMessageRequestRoleEnum[keyof typeof RagNewInternalSchemaAddPublicChatMessageRequestRoleEnum];
/** /**
* *
* @export * @export
@ -936,13 +953,36 @@ export interface RagNewInternalSchemaChatMessageAddRequest {
* @memberof RagNewInternalSchemaChatMessageAddRequest * @memberof RagNewInternalSchemaChatMessageAddRequest
*/ */
'message': string; 'message': string;
/**
*
* @type {string}
* @memberof RagNewInternalSchemaChatMessageAddRequest
*/
'role': RagNewInternalSchemaChatMessageAddRequestRoleEnum;
} }
export const RagNewInternalSchemaChatMessageAddRequestRoleEnum = {
User: 'user',
UserHide: 'user_hide',
System: 'system',
SystemHide: 'system_hide',
Assistant: 'assistant'
} as const;
export type RagNewInternalSchemaChatMessageAddRequestRoleEnum = typeof RagNewInternalSchemaChatMessageAddRequestRoleEnum[keyof typeof RagNewInternalSchemaChatMessageAddRequestRoleEnum];
/** /**
* *
* @export * @export
* @interface RagNewInternalSchemaChatMessageResponse * @interface RagNewInternalSchemaChatMessageResponse
*/ */
export interface RagNewInternalSchemaChatMessageResponse { export interface RagNewInternalSchemaChatMessageResponse {
/**
*
* @type {boolean}
* @memberof RagNewInternalSchemaChatMessageResponse
*/
'stream'?: boolean;
/** /**
* *
* @type {string} * @type {string}
@ -1105,12 +1145,6 @@ export interface RagNewInternalSchemaOpenAIChatCompletionRequestMessage {
* @memberof RagNewInternalSchemaOpenAIChatCompletionRequestMessage * @memberof RagNewInternalSchemaOpenAIChatCompletionRequestMessage
*/ */
'content'?: string; 'content'?: string;
/**
* Optional
* @type {string}
* @memberof RagNewInternalSchemaOpenAIChatCompletionRequestMessage
*/
'name'?: string;
/** /**
* Required * Required
* @type {string} * @type {string}
@ -1126,10 +1160,10 @@ export interface RagNewInternalSchemaOpenAIChatCompletionRequestMessage {
export interface RagNewInternalSchemaOpenAIChatCompletionResponse { export interface RagNewInternalSchemaOpenAIChatCompletionResponse {
/** /**
* *
* @type {Array<RagNewInternalSchemaOpenAIChatCompletionResponseChoicesInner>} * @type {Array<RagNewInternalSchemaOpenAIChatCompletionResponseChoice>}
* @memberof RagNewInternalSchemaOpenAIChatCompletionResponse * @memberof RagNewInternalSchemaOpenAIChatCompletionResponse
*/ */
'choices'?: Array<RagNewInternalSchemaOpenAIChatCompletionResponseChoicesInner>; 'choices'?: Array<RagNewInternalSchemaOpenAIChatCompletionResponseChoice>;
/** /**
* *
* @type {number} * @type {number}
@ -1142,6 +1176,12 @@ export interface RagNewInternalSchemaOpenAIChatCompletionResponse {
* @memberof RagNewInternalSchemaOpenAIChatCompletionResponse * @memberof RagNewInternalSchemaOpenAIChatCompletionResponse
*/ */
'id'?: string; 'id'?: string;
/**
*
* @type {string}
* @memberof RagNewInternalSchemaOpenAIChatCompletionResponse
*/
'model'?: string;
/** /**
* *
* @type {string} * @type {string}
@ -1150,67 +1190,29 @@ export interface RagNewInternalSchemaOpenAIChatCompletionResponse {
'object'?: string; 'object'?: string;
/** /**
* *
* @type {RagNewInternalSchemaOpenAIChatCompletionResponseUsage} * @type {RagNewInternalSchemaTokenUsage}
* @memberof RagNewInternalSchemaOpenAIChatCompletionResponse * @memberof RagNewInternalSchemaOpenAIChatCompletionResponse
*/ */
'usage'?: RagNewInternalSchemaOpenAIChatCompletionResponseUsage; 'usage'?: RagNewInternalSchemaTokenUsage;
} }
/** /**
* *
* @export * @export
* @interface RagNewInternalSchemaOpenAIChatCompletionResponseChoicesInner * @interface RagNewInternalSchemaOpenAIChatCompletionResponseChoice
*/ */
export interface RagNewInternalSchemaOpenAIChatCompletionResponseChoicesInner { export interface RagNewInternalSchemaOpenAIChatCompletionResponseChoice {
/**
*
* @type {string}
* @memberof RagNewInternalSchemaOpenAIChatCompletionResponseChoicesInner
*/
'finish_reason'?: string;
/** /**
* *
* @type {number} * @type {number}
* @memberof RagNewInternalSchemaOpenAIChatCompletionResponseChoicesInner * @memberof RagNewInternalSchemaOpenAIChatCompletionResponseChoice
*/ */
'index'?: number; 'index'?: number;
/** /**
* *
* @type {RagNewInternalSchemaOpenAIChatCompletionResponseChoicesInnerMessage} * @type {RagNewInternalSchemaOpenAIChatCompletionRequestMessage}
* @memberof RagNewInternalSchemaOpenAIChatCompletionResponseChoicesInner * @memberof RagNewInternalSchemaOpenAIChatCompletionResponseChoice
*/ */
'message'?: RagNewInternalSchemaOpenAIChatCompletionResponseChoicesInnerMessage; 'message'?: RagNewInternalSchemaOpenAIChatCompletionRequestMessage;
}
/**
*
* @export
* @interface RagNewInternalSchemaOpenAIChatCompletionResponseChoicesInnerMessage
*/
export interface RagNewInternalSchemaOpenAIChatCompletionResponseChoicesInnerMessage {
/**
*
* @type {string}
* @memberof RagNewInternalSchemaOpenAIChatCompletionResponseChoicesInnerMessage
*/
'content'?: string;
/**
*
* @type {string}
* @memberof RagNewInternalSchemaOpenAIChatCompletionResponseChoicesInnerMessage
*/
'role'?: string;
}
/**
*
* @export
* @interface RagNewInternalSchemaOpenAIChatCompletionResponseUsage
*/
export interface RagNewInternalSchemaOpenAIChatCompletionResponseUsage {
/**
*
* @type {number}
* @memberof RagNewInternalSchemaOpenAIChatCompletionResponseUsage
*/
'total_tokens'?: number;
} }
/** /**
* *
@ -1243,6 +1245,31 @@ export interface RagNewInternalSchemaResponseBody {
*/ */
'success'?: boolean; 'success'?: boolean;
} }
/**
*
* @export
* @interface RagNewInternalSchemaTokenUsage
*/
export interface RagNewInternalSchemaTokenUsage {
/**
*
* @type {number}
* @memberof RagNewInternalSchemaTokenUsage
*/
'completion_tokens'?: number;
/**
*
* @type {number}
* @memberof RagNewInternalSchemaTokenUsage
*/
'prompt_tokens'?: number;
/**
*
* @type {number}
* @memberof RagNewInternalSchemaTokenUsage
*/
'total_tokens'?: number;
}
/** /**
* *
* @export * @export
@ -2311,6 +2338,50 @@ export class AssistantApi extends BaseAPI {
*/ */
export const ChatApiAxiosParamCreator = function (configuration?: Configuration) { export const ChatApiAxiosParamCreator = function (configuration?: Configuration) {
return { return {
/**
* OpenAI Chat Completion 使 Assistant Share Token
* @summary OpenAI Chat Completion
* @param {RagNewInternalSchemaOpenAIChatCompletionRequest} chat Chat
* @param {string} [xUserIP] IP IP Prompt Prompt
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
apiOpenaiCompatibleV1ChatCompletionsPost: async (chat: RagNewInternalSchemaOpenAIChatCompletionRequest, xUserIP?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'chat' is not null or undefined
assertParamExists('apiOpenaiCompatibleV1ChatCompletionsPost', 'chat', chat)
const localVarPath = `/api/openai-compatible/v1/chat/completions`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication ApiKeyAuth required
await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)
if (xUserIP != null) {
localVarHeaderParameter['X-User-IP'] = String(xUserIP);
}
localVarHeaderParameter['Content-Type'] = 'application/json';
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
localVarRequestOptions.data = serializeDataIfNeeded(chat, localVarRequestOptions, configuration)
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/** /**
* get string by ID * get string by ID
* @summary Chat * @summary Chat
@ -2413,45 +2484,6 @@ export const ChatApiAxiosParamCreator = function (configuration?: Configuration)
localVarHeaderParameter['Content-Type'] = 'application/json';
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
localVarRequestOptions.data = serializeDataIfNeeded(chat, localVarRequestOptions, configuration)
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* OpenAI Chat Completion 使 Assistant Share Token
* @summary OpenAI Chat Completion
* @param {RagNewInternalSchemaOpenAIChatCompletionRequest} chat Chat
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
apiV1OpenaiCompatibleCompletionPost: async (chat: RagNewInternalSchemaOpenAIChatCompletionRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'chat' is not null or undefined
assertParamExists('apiV1OpenaiCompatibleCompletionPost', 'chat', chat)
const localVarPath = `/api/v1/openai-compatible/completion`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication ApiKeyAuth required
await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)
localVarHeaderParameter['Content-Type'] = 'application/json'; localVarHeaderParameter['Content-Type'] = 'application/json';
setSearchParams(localVarUrlObj, localVarQueryParameter); setSearchParams(localVarUrlObj, localVarQueryParameter);
@ -2474,6 +2506,20 @@ export const ChatApiAxiosParamCreator = function (configuration?: Configuration)
export const ChatApiFp = function(configuration?: Configuration) { export const ChatApiFp = function(configuration?: Configuration) {
const localVarAxiosParamCreator = ChatApiAxiosParamCreator(configuration) const localVarAxiosParamCreator = ChatApiAxiosParamCreator(configuration)
return { return {
/**
* OpenAI Chat Completion 使 Assistant Share Token
* @summary OpenAI Chat Completion
* @param {RagNewInternalSchemaOpenAIChatCompletionRequest} chat Chat
* @param {string} [xUserIP] IP IP Prompt Prompt
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiOpenaiCompatibleV1ChatCompletionsPost(chat: RagNewInternalSchemaOpenAIChatCompletionRequest, xUserIP?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ApiOpenaiCompatibleV1ChatCompletionsPost200Response>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.apiOpenaiCompatibleV1ChatCompletionsPost(chat, xUserIP, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['ChatApi.apiOpenaiCompatibleV1ChatCompletionsPost']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
/** /**
* get string by ID * get string by ID
* @summary Chat * @summary Chat
@ -2513,19 +2559,6 @@ export const ChatApiFp = function(configuration?: Configuration) {
const localVarOperationServerBasePath = operationServerMap['ChatApi.apiV1ChatsPost']?.[localVarOperationServerIndex]?.url; const localVarOperationServerBasePath = operationServerMap['ChatApi.apiV1ChatsPost']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
}, },
/**
* OpenAI Chat Completion 使 Assistant Share Token
* @summary OpenAI Chat Completion
* @param {RagNewInternalSchemaOpenAIChatCompletionRequest} chat Chat
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async apiV1OpenaiCompatibleCompletionPost(chat: RagNewInternalSchemaOpenAIChatCompletionRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ApiV1OpenaiCompatibleCompletionPost200Response>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.apiV1OpenaiCompatibleCompletionPost(chat, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['ChatApi.apiV1OpenaiCompatibleCompletionPost']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
},
} }
}; };
@ -2536,6 +2569,17 @@ export const ChatApiFp = function(configuration?: Configuration) {
export const ChatApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { export const ChatApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
const localVarFp = ChatApiFp(configuration) const localVarFp = ChatApiFp(configuration)
return { return {
/**
* OpenAI Chat Completion 使 Assistant Share Token
* @summary OpenAI Chat Completion
* @param {RagNewInternalSchemaOpenAIChatCompletionRequest} chat Chat
* @param {string} [xUserIP] IP IP Prompt Prompt
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
apiOpenaiCompatibleV1ChatCompletionsPost(chat: RagNewInternalSchemaOpenAIChatCompletionRequest, xUserIP?: string, options?: any): AxiosPromise<ApiOpenaiCompatibleV1ChatCompletionsPost200Response> {
return localVarFp.apiOpenaiCompatibleV1ChatCompletionsPost(chat, xUserIP, options).then((request) => request(axios, basePath));
},
/** /**
* get string by ID * get string by ID
* @summary Chat * @summary Chat
@ -2566,16 +2610,6 @@ export const ChatApiFactory = function (configuration?: Configuration, basePath?
apiV1ChatsPost(chat: RagNewInternalSchemaChatCreateRequest, options?: any): AxiosPromise<ApiV1ChatPublicPost200Response> { apiV1ChatsPost(chat: RagNewInternalSchemaChatCreateRequest, options?: any): AxiosPromise<ApiV1ChatPublicPost200Response> {
return localVarFp.apiV1ChatsPost(chat, options).then((request) => request(axios, basePath)); return localVarFp.apiV1ChatsPost(chat, options).then((request) => request(axios, basePath));
}, },
/**
* OpenAI Chat Completion 使 Assistant Share Token
* @summary OpenAI Chat Completion
* @param {RagNewInternalSchemaOpenAIChatCompletionRequest} chat Chat
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
apiV1OpenaiCompatibleCompletionPost(chat: RagNewInternalSchemaOpenAIChatCompletionRequest, options?: any): AxiosPromise<ApiV1OpenaiCompatibleCompletionPost200Response> {
return localVarFp.apiV1OpenaiCompatibleCompletionPost(chat, options).then((request) => request(axios, basePath));
},
}; };
}; };
@ -2586,6 +2620,19 @@ export const ChatApiFactory = function (configuration?: Configuration, basePath?
* @extends {BaseAPI} * @extends {BaseAPI}
*/ */
export class ChatApi extends BaseAPI { export class ChatApi extends BaseAPI {
/**
* OpenAI Chat Completion 使 Assistant Share Token
* @summary OpenAI Chat Completion
* @param {RagNewInternalSchemaOpenAIChatCompletionRequest} chat Chat
* @param {string} [xUserIP] IP IP Prompt Prompt
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ChatApi
*/
public apiOpenaiCompatibleV1ChatCompletionsPost(chat: RagNewInternalSchemaOpenAIChatCompletionRequest, xUserIP?: string, options?: RawAxiosRequestConfig) {
return ChatApiFp(this.configuration).apiOpenaiCompatibleV1ChatCompletionsPost(chat, xUserIP, options).then((request) => request(this.axios, this.basePath));
}
/** /**
* get string by ID * get string by ID
* @summary Chat * @summary Chat
@ -2621,18 +2668,6 @@ export class ChatApi extends BaseAPI {
public apiV1ChatsPost(chat: RagNewInternalSchemaChatCreateRequest, options?: RawAxiosRequestConfig) { public apiV1ChatsPost(chat: RagNewInternalSchemaChatCreateRequest, options?: RawAxiosRequestConfig) {
return ChatApiFp(this.configuration).apiV1ChatsPost(chat, options).then((request) => request(this.axios, this.basePath)); return ChatApiFp(this.configuration).apiV1ChatsPost(chat, options).then((request) => request(this.axios, this.basePath));
} }
/**
* OpenAI Chat Completion 使 Assistant Share Token
* @summary OpenAI Chat Completion
* @param {RagNewInternalSchemaOpenAIChatCompletionRequest} chat Chat
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ChatApi
*/
public apiV1OpenaiCompatibleCompletionPost(chat: RagNewInternalSchemaOpenAIChatCompletionRequest, options?: RawAxiosRequestConfig) {
return ChatApiFp(this.configuration).apiV1OpenaiCompatibleCompletionPost(chat, options).then((request) => request(this.axios, this.basePath));
}
} }
@ -2765,10 +2800,11 @@ export const ChatMessageApiAxiosParamCreator = function (configuration?: Configu
* @summary * @summary
* @param {number} id Chat ID * @param {number} id Chat ID
* @param {string} streamId Chat stream id * @param {string} streamId Chat stream id
* @param {string} [xUserIP] IP IP Prompt Prompt
* @param {*} [options] Override http request option. * @param {*} [options] Override http request option.
* @throws {RequiredError} * @throws {RequiredError}
*/ */
apiV1StreamStreamIdGet: async (id: number, streamId: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => { apiV1StreamStreamIdGet: async (id: number, streamId: string, xUserIP?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'id' is not null or undefined // verify required parameter 'id' is not null or undefined
assertParamExists('apiV1StreamStreamIdGet', 'id', id) assertParamExists('apiV1StreamStreamIdGet', 'id', id)
// verify required parameter 'streamId' is not null or undefined // verify required parameter 'streamId' is not null or undefined
@ -2787,6 +2823,10 @@ export const ChatMessageApiAxiosParamCreator = function (configuration?: Configu
const localVarHeaderParameter = {} as any; const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any; const localVarQueryParameter = {} as any;
if (xUserIP != null) {
localVarHeaderParameter['X-User-IP'] = String(xUserIP);
}
setSearchParams(localVarUrlObj, localVarQueryParameter); setSearchParams(localVarUrlObj, localVarQueryParameter);
@ -2853,11 +2893,12 @@ export const ChatMessageApiFp = function(configuration?: Configuration) {
* @summary * @summary
* @param {number} id Chat ID * @param {number} id Chat ID
* @param {string} streamId Chat stream id * @param {string} streamId Chat stream id
* @param {string} [xUserIP] IP IP Prompt Prompt
* @param {*} [options] Override http request option. * @param {*} [options] Override http request option.
* @throws {RequiredError} * @throws {RequiredError}
*/ */
async apiV1StreamStreamIdGet(id: number, streamId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ApiV1ChatPublicChatIdMessagesPost200Response>> { async apiV1StreamStreamIdGet(id: number, streamId: string, xUserIP?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ApiV1ChatPublicChatIdMessagesPost200Response>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.apiV1StreamStreamIdGet(id, streamId, options); const localVarAxiosArgs = await localVarAxiosParamCreator.apiV1StreamStreamIdGet(id, streamId, xUserIP, options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['ChatMessageApi.apiV1StreamStreamIdGet']?.[localVarOperationServerIndex]?.url; const localVarOperationServerBasePath = operationServerMap['ChatMessageApi.apiV1StreamStreamIdGet']?.[localVarOperationServerIndex]?.url;
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
@ -2908,11 +2949,12 @@ export const ChatMessageApiFactory = function (configuration?: Configuration, ba
* @summary * @summary
* @param {number} id Chat ID * @param {number} id Chat ID
* @param {string} streamId Chat stream id * @param {string} streamId Chat stream id
* @param {string} [xUserIP] IP IP Prompt Prompt
* @param {*} [options] Override http request option. * @param {*} [options] Override http request option.
* @throws {RequiredError} * @throws {RequiredError}
*/ */
apiV1StreamStreamIdGet(id: number, streamId: string, options?: any): AxiosPromise<ApiV1ChatPublicChatIdMessagesPost200Response> { apiV1StreamStreamIdGet(id: number, streamId: string, xUserIP?: string, options?: any): AxiosPromise<ApiV1ChatPublicChatIdMessagesPost200Response> {
return localVarFp.apiV1StreamStreamIdGet(id, streamId, options).then((request) => request(axios, basePath)); return localVarFp.apiV1StreamStreamIdGet(id, streamId, xUserIP, options).then((request) => request(axios, basePath));
}, },
}; };
}; };
@ -2966,12 +3008,13 @@ export class ChatMessageApi extends BaseAPI {
* @summary * @summary
* @param {number} id Chat ID * @param {number} id Chat ID
* @param {string} streamId Chat stream id * @param {string} streamId Chat stream id
* @param {string} [xUserIP] IP IP Prompt Prompt
* @param {*} [options] Override http request option. * @param {*} [options] Override http request option.
* @throws {RequiredError} * @throws {RequiredError}
* @memberof ChatMessageApi * @memberof ChatMessageApi
*/ */
public apiV1StreamStreamIdGet(id: number, streamId: string, options?: RawAxiosRequestConfig) { public apiV1StreamStreamIdGet(id: number, streamId: string, xUserIP?: string, options?: RawAxiosRequestConfig) {
return ChatMessageApiFp(this.configuration).apiV1StreamStreamIdGet(id, streamId, options).then((request) => request(this.axios, this.basePath)); return ChatMessageApiFp(this.configuration).apiV1StreamStreamIdGet(id, streamId, xUserIP, options).then((request) => request(this.axios, this.basePath));
} }
} }