diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0215830..f71740b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -16,7 +16,7 @@ repos: exclude: ".hbs$" - id: check-yaml - id: check-added-large-files - exclude: "yarn.lock|.yarn/releases/.*|frontend-demo/.yarn/releases/.*" + exclude: "yarn.lock|.yarn/releases/.*|frontends/.yarn/releases/.*" - id: check-merge-conflict - id: check-toml - id: debug-statements diff --git a/checkpointers/dj_checkpointer/__init__.py b/checkpointers/dj_checkpointer/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/checkpointers/dj_checkpointer/migrations/0001_initial.py b/checkpointers/dj_checkpointer/migrations/0001_initial.py deleted file mode 100644 index ef1867a..0000000 --- a/checkpointers/dj_checkpointer/migrations/0001_initial.py +++ /dev/null @@ -1,46 +0,0 @@ -# Generated by Django 4.2.18 on 2025-02-09 03:03 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - initial = True - - dependencies = [] - - operations = [ - migrations.CreateModel( - name="DjLangCheckpointWrite", - fields=[ - ("thread_id", models.TextField()), - ("checkpoint_ns", models.TextField()), - ("checkpoint_id", models.TextField()), - ("task_id", models.TextField()), - ("idx", models.IntegerField()), - ("channel", models.TextField()), - ("type", models.TextField(blank=True, null=True)), - ("blob", models.BinaryField()), - ("task_path", models.TextField()), - ], - options={ - "unique_together": { - ("thread_id", "checkpoint_ns", "checkpoint_id", "task_id", "idx") - }, - }, - ), - migrations.CreateModel( - name="DjLangCheckpoint", - fields=[ - ("thread_id", models.TextField()), - ("checkpoint_ns", models.TextField()), - ("checkpoint_id", models.TextField()), - ("parent_checkpoint_id", models.TextField(blank=True, null=True)), - ("type", models.TextField(blank=True, null=True)), - ("checkpoint", models.BinaryField()), - ("metadata", models.JSONField()), - ], - options={ - "unique_together": {("thread_id", "checkpoint_ns", "checkpoint_id")}, - }, - ), - ] diff --git a/checkpointers/dj_checkpointer/migrations/__init__.py b/checkpointers/dj_checkpointer/migrations/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/checkpointers/dj_checkpointer/models.py b/checkpointers/dj_checkpointer/models.py deleted file mode 100644 index 8390d4d..0000000 --- a/checkpointers/dj_checkpointer/models.py +++ /dev/null @@ -1,51 +0,0 @@ -""" -Models for langgraph checkpoint tables. These models were reverse-engineered -via inspectdb after running langgraph.checkpoint.postgres.aio.PostgresSaver.setup() -Their data should not be modified by Django, only by langgraph. -""" - -from django.db import models - - -class DjLangCheckpointWrite(models.Model): - """ - Generated by inspectdb from langgraph.checkpoint.postgres.aio.PostgresSaver.setup() - """ - - thread_id = models.TextField() - checkpoint_ns = models.TextField() - checkpoint_id = models.TextField() - task_id = models.TextField() - idx = models.IntegerField() - channel = models.TextField() - type = models.TextField(blank=True, null=True) # noqa: DJ001 - blob = models.BinaryField() - task_path = models.TextField() - - class Meta: - unique_together = ( - ("thread_id", "checkpoint_ns", "checkpoint_id", "task_id", "idx"), - ) - - def __str__(self): - return f"{self.thread_id}-{self.checkpoint_id}-{self.idx}" - - -class DjLangCheckpoint(models.Model): - """ - Generated by inspectdb from langgraph.checkpoint.postgres.aio.PostgresSaver.setup() - """ - - thread_id = models.TextField() - checkpoint_ns = models.TextField() - checkpoint_id = models.TextField() - parent_checkpoint_id = models.TextField(blank=True, null=True) # noqa: DJ001 - type = models.TextField(blank=True, null=True) # noqa: DJ001 - checkpoint = models.BinaryField() - metadata = models.JSONField() - - class Meta: - unique_together = (("thread_id", "checkpoint_ns", "checkpoint_id"),) - - def __str__(self): - return f"{self.thread_id}-{self.checkpoint_id}-{self.type}" diff --git a/frontend-demo/api/src/generated/v0/.gitignore b/frontend-demo/api/src/generated/v0/.gitignore deleted file mode 100644 index 149b576..0000000 --- a/frontend-demo/api/src/generated/v0/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -wwwroot/*.js -node_modules -typings -dist diff --git a/frontend-demo/api/src/generated/v0/.npmignore b/frontend-demo/api/src/generated/v0/.npmignore deleted file mode 100644 index 849dbba..0000000 --- a/frontend-demo/api/src/generated/v0/.npmignore +++ /dev/null @@ -1 +0,0 @@ -# empty npmignore to ensure all required files (e.g., in the dist folder) are published by npm diff --git a/frontend-demo/api/src/generated/v0/.openapi-generator-ignore b/frontend-demo/api/src/generated/v0/.openapi-generator-ignore deleted file mode 100644 index 7484ee5..0000000 --- a/frontend-demo/api/src/generated/v0/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# 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 diff --git a/frontend-demo/api/src/generated/v0/.openapi-generator/FILES b/frontend-demo/api/src/generated/v0/.openapi-generator/FILES deleted file mode 100644 index a80cd4f..0000000 --- a/frontend-demo/api/src/generated/v0/.openapi-generator/FILES +++ /dev/null @@ -1,8 +0,0 @@ -.gitignore -.npmignore -api.ts -base.ts -common.ts -configuration.ts -git_push.sh -index.ts diff --git a/frontend-demo/api/src/generated/v0/.openapi-generator/VERSION b/frontend-demo/api/src/generated/v0/.openapi-generator/VERSION deleted file mode 100644 index 0ee843c..0000000 --- a/frontend-demo/api/src/generated/v0/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -7.2.0 diff --git a/frontend-demo/api/src/generated/v0/api.ts b/frontend-demo/api/src/generated/v0/api.ts deleted file mode 100644 index 67401d6..0000000 --- a/frontend-demo/api/src/generated/v0/api.ts +++ /dev/null @@ -1,1483 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Learn AI API - * MIT public API - * - * The version of the OpenAPI document: 0.0.1 (v0) - * - * - * 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 { Configuration } from "./configuration" -import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from "axios" -import globalAxios from "axios" -// Some imports not used depending on template conditions -// @ts-ignore -import { - DUMMY_BASE_URL, - assertParamExists, - setApiKeyToObject, - setBasicAuthToObject, - setBearerAuthToObject, - setOAuthToObject, - setSearchParams, - serializeDataIfNeeded, - toPathString, - createRequestFunction, -} from "./common" -import type { RequestArgs } from "./base" -// @ts-ignore -import { - BASE_PATH, - COLLECTION_FORMATS, - BaseAPI, - RequiredError, - operationServerMap, -} from "./base" - -/** - * Serializer for chat messages. This serializer is used to return just the message, content and role, and is intended to backfill chat history in a frontend UI. - * @export - * @interface ChatMessage - */ -export interface ChatMessage { - /** - * - * @type {string} - * @memberof ChatMessage - */ - checkpoint_id: string - /** - * - * @type {string} - * @memberof ChatMessage - */ - role: string - /** - * - * @type {string} - * @memberof ChatMessage - */ - content: string -} -/** - * - * @export - * @interface PaginatedChatMessageList - */ -export interface PaginatedChatMessageList { - /** - * - * @type {number} - * @memberof PaginatedChatMessageList - */ - count: number - /** - * - * @type {string} - * @memberof PaginatedChatMessageList - */ - next?: string | null - /** - * - * @type {string} - * @memberof PaginatedChatMessageList - */ - previous?: string | null - /** - * - * @type {Array} - * @memberof PaginatedChatMessageList - */ - results: Array -} -/** - * - * @export - * @interface PaginatedUserChatSessionList - */ -export interface PaginatedUserChatSessionList { - /** - * - * @type {number} - * @memberof PaginatedUserChatSessionList - */ - count: number - /** - * - * @type {string} - * @memberof PaginatedUserChatSessionList - */ - next?: string | null - /** - * - * @type {string} - * @memberof PaginatedUserChatSessionList - */ - previous?: string | null - /** - * - * @type {Array} - * @memberof PaginatedUserChatSessionList - */ - results: Array -} -/** - * Serializer for user chat sessions - * @export - * @interface PatchedUserChatSessionRequest - */ -export interface PatchedUserChatSessionRequest { - /** - * - * @type {string} - * @memberof PatchedUserChatSessionRequest - */ - title?: string -} -/** - * - * @export - * @interface RecommendationAgentV0Request - */ -export interface RecommendationAgentV0Request { - /** - * The user\'s message to the AI - * @type {string} - * @memberof RecommendationAgentV0Request - */ - message: string - /** - * The LLM model to use - * @type {string} - * @memberof RecommendationAgentV0Request - */ - model?: string - /** - * The LLM temperature to use - * @type {number} - * @memberof RecommendationAgentV0Request - */ - temperature?: number - /** - * System prompt (admins only) - * @type {string} - * @memberof RecommendationAgentV0Request - */ - instructions?: string - /** - * Whether to clear chat history - * @type {boolean} - * @memberof RecommendationAgentV0Request - */ - clear_history?: boolean - /** - * The thread id to use - * @type {string} - * @memberof RecommendationAgentV0Request - */ - thread_id?: string -} -/** - * - * @export - * @interface SyllabusAgentV0Request - */ -export interface SyllabusAgentV0Request { - /** - * The user\'s message to the AI - * @type {string} - * @memberof SyllabusAgentV0Request - */ - message: string - /** - * The course id - * @type {string} - * @memberof SyllabusAgentV0Request - */ - course_id: string - /** - * Vector embedding collection name - * @type {string} - * @memberof SyllabusAgentV0Request - */ - collection_name?: string - /** - * The LLM model to use - * @type {string} - * @memberof SyllabusAgentV0Request - */ - model?: string - /** - * The LLM temperature to use - * @type {number} - * @memberof SyllabusAgentV0Request - */ - temperature?: number - /** - * System prompt (admins only) - * @type {string} - * @memberof SyllabusAgentV0Request - */ - instructions?: string - /** - * Whether to clear chat history - * @type {boolean} - * @memberof SyllabusAgentV0Request - */ - clear_history?: boolean - /** - * The thread id to use - * @type {string} - * @memberof SyllabusAgentV0Request - */ - thread_id?: string -} -/** - * Serializer for user chat sessions - * @export - * @interface UserChatSession - */ -export interface UserChatSession { - /** - * - * @type {string} - * @memberof UserChatSession - */ - thread_id: string - /** - * - * @type {string} - * @memberof UserChatSession - */ - title?: string - /** - * - * @type {number} - * @memberof UserChatSession - */ - user: number | null - /** - * - * @type {string} - * @memberof UserChatSession - */ - created_on: string - /** - * - * @type {string} - * @memberof UserChatSession - */ - updated_on: string -} -/** - * Serializer for user chat sessions - * @export - * @interface UserChatSessionRequest - */ -export interface UserChatSessionRequest { - /** - * - * @type {string} - * @memberof UserChatSessionRequest - */ - title?: string -} - -/** - * ChannelsApi - axios parameter creator - * @export - */ -export const ChannelsApiAxiosParamCreator = function ( - configuration?: Configuration, -) { - return { - /** - * Recommendation agent endpoint via AsyncHttpConsumer - * @param {RecommendationAgentV0Request} RecommendationAgentV0Request - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - recommendationAgentV0: async ( - RecommendationAgentV0Request: RecommendationAgentV0Request, - options: RawAxiosRequestConfig = {}, - ): Promise => { - // verify required parameter 'RecommendationAgentV0Request' is not null or undefined - assertParamExists( - "recommendationAgentV0", - "RecommendationAgentV0Request", - RecommendationAgentV0Request, - ) - const localVarPath = `/http/recommendation_agent/` - // 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 - - localVarHeaderParameter["Content-Type"] = "application/json" - - setSearchParams(localVarUrlObj, localVarQueryParameter) - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {} - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - } - localVarRequestOptions.data = serializeDataIfNeeded( - RecommendationAgentV0Request, - localVarRequestOptions, - configuration, - ) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - } - }, - /** - * Syllabus agent endpoint via AsyncHttpConsumer - * @param {SyllabusAgentV0Request} SyllabusAgentV0Request - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - syllabusAgentV0: async ( - SyllabusAgentV0Request: SyllabusAgentV0Request, - options: RawAxiosRequestConfig = {}, - ): Promise => { - // verify required parameter 'SyllabusAgentV0Request' is not null or undefined - assertParamExists( - "syllabusAgentV0", - "SyllabusAgentV0Request", - SyllabusAgentV0Request, - ) - const localVarPath = `/http/syllabus_agent/` - // 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 - - localVarHeaderParameter["Content-Type"] = "application/json" - - setSearchParams(localVarUrlObj, localVarQueryParameter) - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {} - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - } - localVarRequestOptions.data = serializeDataIfNeeded( - SyllabusAgentV0Request, - localVarRequestOptions, - configuration, - ) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - } - }, - } -} - -/** - * ChannelsApi - functional programming interface - * @export - */ -export const ChannelsApiFp = function (configuration?: Configuration) { - const localVarAxiosParamCreator = ChannelsApiAxiosParamCreator(configuration) - return { - /** - * Recommendation agent endpoint via AsyncHttpConsumer - * @param {RecommendationAgentV0Request} RecommendationAgentV0Request - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async recommendationAgentV0( - RecommendationAgentV0Request: RecommendationAgentV0Request, - options?: RawAxiosRequestConfig, - ): Promise< - (axios?: AxiosInstance, basePath?: string) => AxiosPromise - > { - const localVarAxiosArgs = - await localVarAxiosParamCreator.recommendationAgentV0( - RecommendationAgentV0Request, - options, - ) - const index = configuration?.serverIndex ?? 0 - const operationBasePath = - operationServerMap["ChannelsApi.recommendationAgentV0"]?.[index]?.url - return (axios, basePath) => - createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration, - )(axios, operationBasePath || basePath) - }, - /** - * Syllabus agent endpoint via AsyncHttpConsumer - * @param {SyllabusAgentV0Request} SyllabusAgentV0Request - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async syllabusAgentV0( - SyllabusAgentV0Request: SyllabusAgentV0Request, - options?: RawAxiosRequestConfig, - ): Promise< - (axios?: AxiosInstance, basePath?: string) => AxiosPromise - > { - const localVarAxiosArgs = await localVarAxiosParamCreator.syllabusAgentV0( - SyllabusAgentV0Request, - options, - ) - const index = configuration?.serverIndex ?? 0 - const operationBasePath = - operationServerMap["ChannelsApi.syllabusAgentV0"]?.[index]?.url - return (axios, basePath) => - createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration, - )(axios, operationBasePath || basePath) - }, - } -} - -/** - * ChannelsApi - factory interface - * @export - */ -export const ChannelsApiFactory = function ( - configuration?: Configuration, - basePath?: string, - axios?: AxiosInstance, -) { - const localVarFp = ChannelsApiFp(configuration) - return { - /** - * Recommendation agent endpoint via AsyncHttpConsumer - * @param {ChannelsApiRecommendationAgentV0Request} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - recommendationAgentV0( - requestParameters: ChannelsApiRecommendationAgentV0Request, - options?: RawAxiosRequestConfig, - ): AxiosPromise { - return localVarFp - .recommendationAgentV0( - requestParameters.RecommendationAgentV0Request, - options, - ) - .then((request) => request(axios, basePath)) - }, - /** - * Syllabus agent endpoint via AsyncHttpConsumer - * @param {ChannelsApiSyllabusAgentV0Request} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - syllabusAgentV0( - requestParameters: ChannelsApiSyllabusAgentV0Request, - options?: RawAxiosRequestConfig, - ): AxiosPromise { - return localVarFp - .syllabusAgentV0(requestParameters.SyllabusAgentV0Request, options) - .then((request) => request(axios, basePath)) - }, - } -} - -/** - * Request parameters for recommendationAgentV0 operation in ChannelsApi. - * @export - * @interface ChannelsApiRecommendationAgentV0Request - */ -export interface ChannelsApiRecommendationAgentV0Request { - /** - * - * @type {RecommendationAgentV0Request} - * @memberof ChannelsApiRecommendationAgentV0 - */ - readonly RecommendationAgentV0Request: RecommendationAgentV0Request -} - -/** - * Request parameters for syllabusAgentV0 operation in ChannelsApi. - * @export - * @interface ChannelsApiSyllabusAgentV0Request - */ -export interface ChannelsApiSyllabusAgentV0Request { - /** - * - * @type {SyllabusAgentV0Request} - * @memberof ChannelsApiSyllabusAgentV0 - */ - readonly SyllabusAgentV0Request: SyllabusAgentV0Request -} - -/** - * ChannelsApi - object-oriented interface - * @export - * @class ChannelsApi - * @extends {BaseAPI} - */ -export class ChannelsApi extends BaseAPI { - /** - * Recommendation agent endpoint via AsyncHttpConsumer - * @param {ChannelsApiRecommendationAgentV0Request} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof ChannelsApi - */ - public recommendationAgentV0( - requestParameters: ChannelsApiRecommendationAgentV0Request, - options?: RawAxiosRequestConfig, - ) { - return ChannelsApiFp(this.configuration) - .recommendationAgentV0( - requestParameters.RecommendationAgentV0Request, - options, - ) - .then((request) => request(this.axios, this.basePath)) - } - - /** - * Syllabus agent endpoint via AsyncHttpConsumer - * @param {ChannelsApiSyllabusAgentV0Request} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof ChannelsApi - */ - public syllabusAgentV0( - requestParameters: ChannelsApiSyllabusAgentV0Request, - options?: RawAxiosRequestConfig, - ) { - return ChannelsApiFp(this.configuration) - .syllabusAgentV0(requestParameters.SyllabusAgentV0Request, options) - .then((request) => request(this.axios, this.basePath)) - } -} - -/** - * ChatSessionsApi - axios parameter creator - * @export - */ -export const ChatSessionsApiAxiosParamCreator = function ( - configuration?: Configuration, -) { - return { - /** - * API endpoint that allows user session chats to be viewed or edited. - * @param {string} thread_id thread id of the chat session - * @param {UserChatSessionRequest} [UserChatSessionRequest] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - chatSessionsCreate: async ( - thread_id: string, - UserChatSessionRequest?: UserChatSessionRequest, - options: RawAxiosRequestConfig = {}, - ): Promise => { - // verify required parameter 'thread_id' is not null or undefined - assertParamExists("chatSessionsCreate", "thread_id", thread_id) - const localVarPath = `/api/v0/chat_sessions/`.replace( - `{${"thread_id"}}`, - encodeURIComponent(String(thread_id)), - ) - // 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 - - localVarHeaderParameter["Content-Type"] = "application/json" - - setSearchParams(localVarUrlObj, localVarQueryParameter) - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {} - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - } - localVarRequestOptions.data = serializeDataIfNeeded( - UserChatSessionRequest, - localVarRequestOptions, - configuration, - ) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - } - }, - /** - * API endpoint that allows user session chats to be viewed or edited. - * @param {string} thread_id thread id of the chat session - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - chatSessionsDestroy: async ( - thread_id: string, - options: RawAxiosRequestConfig = {}, - ): Promise => { - // verify required parameter 'thread_id' is not null or undefined - assertParamExists("chatSessionsDestroy", "thread_id", thread_id) - const localVarPath = `/api/v0/chat_sessions/{thread_id}/`.replace( - `{${"thread_id"}}`, - encodeURIComponent(String(thread_id)), - ) - // 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: "DELETE", - ...baseOptions, - ...options, - } - const localVarHeaderParameter = {} as any - const localVarQueryParameter = {} as any - - setSearchParams(localVarUrlObj, localVarQueryParameter) - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {} - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - } - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - } - }, - /** - * API endpoint that allows user session chats to be viewed or edited. - * @param {string} thread_id thread id of the chat session - * @param {number} [limit] Number of results to return per page. - * @param {number} [offset] The initial index from which to return the results. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - chatSessionsList: async ( - thread_id: string, - limit?: number, - offset?: number, - options: RawAxiosRequestConfig = {}, - ): Promise => { - // verify required parameter 'thread_id' is not null or undefined - assertParamExists("chatSessionsList", "thread_id", thread_id) - const localVarPath = `/api/v0/chat_sessions/`.replace( - `{${"thread_id"}}`, - encodeURIComponent(String(thread_id)), - ) - // 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: "GET", - ...baseOptions, - ...options, - } - const localVarHeaderParameter = {} as any - const localVarQueryParameter = {} as any - - if (limit !== undefined) { - localVarQueryParameter["limit"] = limit - } - - if (offset !== undefined) { - localVarQueryParameter["offset"] = offset - } - - setSearchParams(localVarUrlObj, localVarQueryParameter) - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {} - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - } - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - } - }, - /** - * Read-only API endpoint for returning just human/agent chat messages in a thread. - * @param {string} thread_id thread id of the chat session - * @param {number} [limit] Number of results to return per page. - * @param {number} [offset] The initial index from which to return the results. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - chatSessionsMessagesList: async ( - thread_id: string, - limit?: number, - offset?: number, - options: RawAxiosRequestConfig = {}, - ): Promise => { - // verify required parameter 'thread_id' is not null or undefined - assertParamExists("chatSessionsMessagesList", "thread_id", thread_id) - const localVarPath = - `/api/v0/chat_sessions/{thread_id}/messages/`.replace( - `{${"thread_id"}}`, - encodeURIComponent(String(thread_id)), - ) - // 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: "GET", - ...baseOptions, - ...options, - } - const localVarHeaderParameter = {} as any - const localVarQueryParameter = {} as any - - if (limit !== undefined) { - localVarQueryParameter["limit"] = limit - } - - if (offset !== undefined) { - localVarQueryParameter["offset"] = offset - } - - setSearchParams(localVarUrlObj, localVarQueryParameter) - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {} - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - } - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - } - }, - /** - * API endpoint that allows user session chats to be viewed or edited. - * @param {string} thread_id thread id of the chat session - * @param {PatchedUserChatSessionRequest} [PatchedUserChatSessionRequest] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - chatSessionsPartialUpdate: async ( - thread_id: string, - PatchedUserChatSessionRequest?: PatchedUserChatSessionRequest, - options: RawAxiosRequestConfig = {}, - ): Promise => { - // verify required parameter 'thread_id' is not null or undefined - assertParamExists("chatSessionsPartialUpdate", "thread_id", thread_id) - const localVarPath = `/api/v0/chat_sessions/{thread_id}/`.replace( - `{${"thread_id"}}`, - encodeURIComponent(String(thread_id)), - ) - // 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: "PATCH", - ...baseOptions, - ...options, - } - const localVarHeaderParameter = {} as any - const localVarQueryParameter = {} as any - - localVarHeaderParameter["Content-Type"] = "application/json" - - setSearchParams(localVarUrlObj, localVarQueryParameter) - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {} - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - } - localVarRequestOptions.data = serializeDataIfNeeded( - PatchedUserChatSessionRequest, - localVarRequestOptions, - configuration, - ) - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - } - }, - /** - * API endpoint that allows user session chats to be viewed or edited. - * @param {string} thread_id thread id of the chat session - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - chatSessionsRetrieve: async ( - thread_id: string, - options: RawAxiosRequestConfig = {}, - ): Promise => { - // verify required parameter 'thread_id' is not null or undefined - assertParamExists("chatSessionsRetrieve", "thread_id", thread_id) - const localVarPath = `/api/v0/chat_sessions/{thread_id}/`.replace( - `{${"thread_id"}}`, - encodeURIComponent(String(thread_id)), - ) - // 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: "GET", - ...baseOptions, - ...options, - } - const localVarHeaderParameter = {} as any - const localVarQueryParameter = {} as any - - setSearchParams(localVarUrlObj, localVarQueryParameter) - let headersFromBaseOptions = - baseOptions && baseOptions.headers ? baseOptions.headers : {} - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - } - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - } - }, - } -} - -/** - * ChatSessionsApi - functional programming interface - * @export - */ -export const ChatSessionsApiFp = function (configuration?: Configuration) { - const localVarAxiosParamCreator = - ChatSessionsApiAxiosParamCreator(configuration) - return { - /** - * API endpoint that allows user session chats to be viewed or edited. - * @param {string} thread_id thread id of the chat session - * @param {UserChatSessionRequest} [UserChatSessionRequest] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async chatSessionsCreate( - thread_id: string, - UserChatSessionRequest?: UserChatSessionRequest, - options?: RawAxiosRequestConfig, - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string, - ) => AxiosPromise - > { - const localVarAxiosArgs = - await localVarAxiosParamCreator.chatSessionsCreate( - thread_id, - UserChatSessionRequest, - options, - ) - const index = configuration?.serverIndex ?? 0 - const operationBasePath = - operationServerMap["ChatSessionsApi.chatSessionsCreate"]?.[index]?.url - return (axios, basePath) => - createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration, - )(axios, operationBasePath || basePath) - }, - /** - * API endpoint that allows user session chats to be viewed or edited. - * @param {string} thread_id thread id of the chat session - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async chatSessionsDestroy( - thread_id: string, - options?: RawAxiosRequestConfig, - ): Promise< - (axios?: AxiosInstance, basePath?: string) => AxiosPromise - > { - const localVarAxiosArgs = - await localVarAxiosParamCreator.chatSessionsDestroy(thread_id, options) - const index = configuration?.serverIndex ?? 0 - const operationBasePath = - operationServerMap["ChatSessionsApi.chatSessionsDestroy"]?.[index]?.url - return (axios, basePath) => - createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration, - )(axios, operationBasePath || basePath) - }, - /** - * API endpoint that allows user session chats to be viewed or edited. - * @param {string} thread_id thread id of the chat session - * @param {number} [limit] Number of results to return per page. - * @param {number} [offset] The initial index from which to return the results. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async chatSessionsList( - thread_id: string, - limit?: number, - offset?: number, - options?: RawAxiosRequestConfig, - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string, - ) => AxiosPromise - > { - const localVarAxiosArgs = - await localVarAxiosParamCreator.chatSessionsList( - thread_id, - limit, - offset, - options, - ) - const index = configuration?.serverIndex ?? 0 - const operationBasePath = - operationServerMap["ChatSessionsApi.chatSessionsList"]?.[index]?.url - return (axios, basePath) => - createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration, - )(axios, operationBasePath || basePath) - }, - /** - * Read-only API endpoint for returning just human/agent chat messages in a thread. - * @param {string} thread_id thread id of the chat session - * @param {number} [limit] Number of results to return per page. - * @param {number} [offset] The initial index from which to return the results. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async chatSessionsMessagesList( - thread_id: string, - limit?: number, - offset?: number, - options?: RawAxiosRequestConfig, - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string, - ) => AxiosPromise - > { - const localVarAxiosArgs = - await localVarAxiosParamCreator.chatSessionsMessagesList( - thread_id, - limit, - offset, - options, - ) - const index = configuration?.serverIndex ?? 0 - const operationBasePath = - operationServerMap["ChatSessionsApi.chatSessionsMessagesList"]?.[index] - ?.url - return (axios, basePath) => - createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration, - )(axios, operationBasePath || basePath) - }, - /** - * API endpoint that allows user session chats to be viewed or edited. - * @param {string} thread_id thread id of the chat session - * @param {PatchedUserChatSessionRequest} [PatchedUserChatSessionRequest] - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async chatSessionsPartialUpdate( - thread_id: string, - PatchedUserChatSessionRequest?: PatchedUserChatSessionRequest, - options?: RawAxiosRequestConfig, - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string, - ) => AxiosPromise - > { - const localVarAxiosArgs = - await localVarAxiosParamCreator.chatSessionsPartialUpdate( - thread_id, - PatchedUserChatSessionRequest, - options, - ) - const index = configuration?.serverIndex ?? 0 - const operationBasePath = - operationServerMap["ChatSessionsApi.chatSessionsPartialUpdate"]?.[index] - ?.url - return (axios, basePath) => - createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration, - )(axios, operationBasePath || basePath) - }, - /** - * API endpoint that allows user session chats to be viewed or edited. - * @param {string} thread_id thread id of the chat session - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async chatSessionsRetrieve( - thread_id: string, - options?: RawAxiosRequestConfig, - ): Promise< - ( - axios?: AxiosInstance, - basePath?: string, - ) => AxiosPromise - > { - const localVarAxiosArgs = - await localVarAxiosParamCreator.chatSessionsRetrieve(thread_id, options) - const index = configuration?.serverIndex ?? 0 - const operationBasePath = - operationServerMap["ChatSessionsApi.chatSessionsRetrieve"]?.[index]?.url - return (axios, basePath) => - createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration, - )(axios, operationBasePath || basePath) - }, - } -} - -/** - * ChatSessionsApi - factory interface - * @export - */ -export const ChatSessionsApiFactory = function ( - configuration?: Configuration, - basePath?: string, - axios?: AxiosInstance, -) { - const localVarFp = ChatSessionsApiFp(configuration) - return { - /** - * API endpoint that allows user session chats to be viewed or edited. - * @param {ChatSessionsApiChatSessionsCreateRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - chatSessionsCreate( - requestParameters: ChatSessionsApiChatSessionsCreateRequest, - options?: RawAxiosRequestConfig, - ): AxiosPromise { - return localVarFp - .chatSessionsCreate( - requestParameters.thread_id, - requestParameters.UserChatSessionRequest, - options, - ) - .then((request) => request(axios, basePath)) - }, - /** - * API endpoint that allows user session chats to be viewed or edited. - * @param {ChatSessionsApiChatSessionsDestroyRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - chatSessionsDestroy( - requestParameters: ChatSessionsApiChatSessionsDestroyRequest, - options?: RawAxiosRequestConfig, - ): AxiosPromise { - return localVarFp - .chatSessionsDestroy(requestParameters.thread_id, options) - .then((request) => request(axios, basePath)) - }, - /** - * API endpoint that allows user session chats to be viewed or edited. - * @param {ChatSessionsApiChatSessionsListRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - chatSessionsList( - requestParameters: ChatSessionsApiChatSessionsListRequest, - options?: RawAxiosRequestConfig, - ): AxiosPromise { - return localVarFp - .chatSessionsList( - requestParameters.thread_id, - requestParameters.limit, - requestParameters.offset, - options, - ) - .then((request) => request(axios, basePath)) - }, - /** - * Read-only API endpoint for returning just human/agent chat messages in a thread. - * @param {ChatSessionsApiChatSessionsMessagesListRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - chatSessionsMessagesList( - requestParameters: ChatSessionsApiChatSessionsMessagesListRequest, - options?: RawAxiosRequestConfig, - ): AxiosPromise { - return localVarFp - .chatSessionsMessagesList( - requestParameters.thread_id, - requestParameters.limit, - requestParameters.offset, - options, - ) - .then((request) => request(axios, basePath)) - }, - /** - * API endpoint that allows user session chats to be viewed or edited. - * @param {ChatSessionsApiChatSessionsPartialUpdateRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - chatSessionsPartialUpdate( - requestParameters: ChatSessionsApiChatSessionsPartialUpdateRequest, - options?: RawAxiosRequestConfig, - ): AxiosPromise { - return localVarFp - .chatSessionsPartialUpdate( - requestParameters.thread_id, - requestParameters.PatchedUserChatSessionRequest, - options, - ) - .then((request) => request(axios, basePath)) - }, - /** - * API endpoint that allows user session chats to be viewed or edited. - * @param {ChatSessionsApiChatSessionsRetrieveRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - chatSessionsRetrieve( - requestParameters: ChatSessionsApiChatSessionsRetrieveRequest, - options?: RawAxiosRequestConfig, - ): AxiosPromise { - return localVarFp - .chatSessionsRetrieve(requestParameters.thread_id, options) - .then((request) => request(axios, basePath)) - }, - } -} - -/** - * Request parameters for chatSessionsCreate operation in ChatSessionsApi. - * @export - * @interface ChatSessionsApiChatSessionsCreateRequest - */ -export interface ChatSessionsApiChatSessionsCreateRequest { - /** - * thread id of the chat session - * @type {string} - * @memberof ChatSessionsApiChatSessionsCreate - */ - readonly thread_id: string - - /** - * - * @type {UserChatSessionRequest} - * @memberof ChatSessionsApiChatSessionsCreate - */ - readonly UserChatSessionRequest?: UserChatSessionRequest -} - -/** - * Request parameters for chatSessionsDestroy operation in ChatSessionsApi. - * @export - * @interface ChatSessionsApiChatSessionsDestroyRequest - */ -export interface ChatSessionsApiChatSessionsDestroyRequest { - /** - * thread id of the chat session - * @type {string} - * @memberof ChatSessionsApiChatSessionsDestroy - */ - readonly thread_id: string -} - -/** - * Request parameters for chatSessionsList operation in ChatSessionsApi. - * @export - * @interface ChatSessionsApiChatSessionsListRequest - */ -export interface ChatSessionsApiChatSessionsListRequest { - /** - * thread id of the chat session - * @type {string} - * @memberof ChatSessionsApiChatSessionsList - */ - readonly thread_id: string - - /** - * Number of results to return per page. - * @type {number} - * @memberof ChatSessionsApiChatSessionsList - */ - readonly limit?: number - - /** - * The initial index from which to return the results. - * @type {number} - * @memberof ChatSessionsApiChatSessionsList - */ - readonly offset?: number -} - -/** - * Request parameters for chatSessionsMessagesList operation in ChatSessionsApi. - * @export - * @interface ChatSessionsApiChatSessionsMessagesListRequest - */ -export interface ChatSessionsApiChatSessionsMessagesListRequest { - /** - * thread id of the chat session - * @type {string} - * @memberof ChatSessionsApiChatSessionsMessagesList - */ - readonly thread_id: string - - /** - * Number of results to return per page. - * @type {number} - * @memberof ChatSessionsApiChatSessionsMessagesList - */ - readonly limit?: number - - /** - * The initial index from which to return the results. - * @type {number} - * @memberof ChatSessionsApiChatSessionsMessagesList - */ - readonly offset?: number -} - -/** - * Request parameters for chatSessionsPartialUpdate operation in ChatSessionsApi. - * @export - * @interface ChatSessionsApiChatSessionsPartialUpdateRequest - */ -export interface ChatSessionsApiChatSessionsPartialUpdateRequest { - /** - * thread id of the chat session - * @type {string} - * @memberof ChatSessionsApiChatSessionsPartialUpdate - */ - readonly thread_id: string - - /** - * - * @type {PatchedUserChatSessionRequest} - * @memberof ChatSessionsApiChatSessionsPartialUpdate - */ - readonly PatchedUserChatSessionRequest?: PatchedUserChatSessionRequest -} - -/** - * Request parameters for chatSessionsRetrieve operation in ChatSessionsApi. - * @export - * @interface ChatSessionsApiChatSessionsRetrieveRequest - */ -export interface ChatSessionsApiChatSessionsRetrieveRequest { - /** - * thread id of the chat session - * @type {string} - * @memberof ChatSessionsApiChatSessionsRetrieve - */ - readonly thread_id: string -} - -/** - * ChatSessionsApi - object-oriented interface - * @export - * @class ChatSessionsApi - * @extends {BaseAPI} - */ -export class ChatSessionsApi extends BaseAPI { - /** - * API endpoint that allows user session chats to be viewed or edited. - * @param {ChatSessionsApiChatSessionsCreateRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof ChatSessionsApi - */ - public chatSessionsCreate( - requestParameters: ChatSessionsApiChatSessionsCreateRequest, - options?: RawAxiosRequestConfig, - ) { - return ChatSessionsApiFp(this.configuration) - .chatSessionsCreate( - requestParameters.thread_id, - requestParameters.UserChatSessionRequest, - options, - ) - .then((request) => request(this.axios, this.basePath)) - } - - /** - * API endpoint that allows user session chats to be viewed or edited. - * @param {ChatSessionsApiChatSessionsDestroyRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof ChatSessionsApi - */ - public chatSessionsDestroy( - requestParameters: ChatSessionsApiChatSessionsDestroyRequest, - options?: RawAxiosRequestConfig, - ) { - return ChatSessionsApiFp(this.configuration) - .chatSessionsDestroy(requestParameters.thread_id, options) - .then((request) => request(this.axios, this.basePath)) - } - - /** - * API endpoint that allows user session chats to be viewed or edited. - * @param {ChatSessionsApiChatSessionsListRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof ChatSessionsApi - */ - public chatSessionsList( - requestParameters: ChatSessionsApiChatSessionsListRequest, - options?: RawAxiosRequestConfig, - ) { - return ChatSessionsApiFp(this.configuration) - .chatSessionsList( - requestParameters.thread_id, - requestParameters.limit, - requestParameters.offset, - options, - ) - .then((request) => request(this.axios, this.basePath)) - } - - /** - * Read-only API endpoint for returning just human/agent chat messages in a thread. - * @param {ChatSessionsApiChatSessionsMessagesListRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof ChatSessionsApi - */ - public chatSessionsMessagesList( - requestParameters: ChatSessionsApiChatSessionsMessagesListRequest, - options?: RawAxiosRequestConfig, - ) { - return ChatSessionsApiFp(this.configuration) - .chatSessionsMessagesList( - requestParameters.thread_id, - requestParameters.limit, - requestParameters.offset, - options, - ) - .then((request) => request(this.axios, this.basePath)) - } - - /** - * API endpoint that allows user session chats to be viewed or edited. - * @param {ChatSessionsApiChatSessionsPartialUpdateRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof ChatSessionsApi - */ - public chatSessionsPartialUpdate( - requestParameters: ChatSessionsApiChatSessionsPartialUpdateRequest, - options?: RawAxiosRequestConfig, - ) { - return ChatSessionsApiFp(this.configuration) - .chatSessionsPartialUpdate( - requestParameters.thread_id, - requestParameters.PatchedUserChatSessionRequest, - options, - ) - .then((request) => request(this.axios, this.basePath)) - } - - /** - * API endpoint that allows user session chats to be viewed or edited. - * @param {ChatSessionsApiChatSessionsRetrieveRequest} requestParameters Request parameters. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof ChatSessionsApi - */ - public chatSessionsRetrieve( - requestParameters: ChatSessionsApiChatSessionsRetrieveRequest, - options?: RawAxiosRequestConfig, - ) { - return ChatSessionsApiFp(this.configuration) - .chatSessionsRetrieve(requestParameters.thread_id, options) - .then((request) => request(this.axios, this.basePath)) - } -} diff --git a/frontend-demo/api/src/generated/v0/base.ts b/frontend-demo/api/src/generated/v0/base.ts deleted file mode 100644 index 4ffdead..0000000 --- a/frontend-demo/api/src/generated/v0/base.ts +++ /dev/null @@ -1,91 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Learn AI API - * MIT public API - * - * The version of the OpenAPI document: 0.0.1 (v0) - * - * - * 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 { Configuration } from "./configuration" -// Some imports not used depending on template conditions -// @ts-ignore -import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from "axios" -import globalAxios from "axios" - -export const BASE_PATH = "http://localhost".replace(/\/+$/, "") - -/** - * - * @export - */ -export const COLLECTION_FORMATS = { - csv: ",", - ssv: " ", - tsv: "\t", - pipes: "|", -} - -/** - * - * @export - * @interface RequestArgs - */ -export interface RequestArgs { - url: string - options: RawAxiosRequestConfig -} - -/** - * - * @export - * @class BaseAPI - */ -export class BaseAPI { - protected configuration: Configuration | undefined - - constructor( - configuration?: Configuration, - protected basePath: string = BASE_PATH, - protected axios: AxiosInstance = globalAxios, - ) { - if (configuration) { - this.configuration = configuration - this.basePath = configuration.basePath ?? basePath - } - } -} - -/** - * - * @export - * @class RequiredError - * @extends {Error} - */ -export class RequiredError extends Error { - constructor( - public field: string, - msg?: string, - ) { - super(msg) - this.name = "RequiredError" - } -} - -interface ServerMap { - [key: string]: { - url: string - description: string - }[] -} - -/** - * - * @export - */ -export const operationServerMap: ServerMap = {} diff --git a/frontend-demo/api/src/generated/v0/common.ts b/frontend-demo/api/src/generated/v0/common.ts deleted file mode 100644 index 0ec6847..0000000 --- a/frontend-demo/api/src/generated/v0/common.ts +++ /dev/null @@ -1,202 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Learn AI API - * MIT public API - * - * The version of the OpenAPI document: 0.0.1 (v0) - * - * - * 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 { Configuration } from "./configuration" -import type { RequestArgs } from "./base" -import type { AxiosInstance, AxiosResponse } from "axios" -import { RequiredError } from "./base" - -/** - * - * @export - */ -export const DUMMY_BASE_URL = "https://example.com" - -/** - * - * @throws {RequiredError} - * @export - */ -export const assertParamExists = function ( - functionName: string, - paramName: string, - paramValue: unknown, -) { - if (paramValue === null || paramValue === undefined) { - throw new RequiredError( - paramName, - `Required parameter ${paramName} was null or undefined when calling ${functionName}.`, - ) - } -} - -/** - * - * @export - */ -export const setApiKeyToObject = async function ( - object: any, - keyParamName: string, - configuration?: Configuration, -) { - if (configuration && configuration.apiKey) { - const localVarApiKeyValue = - typeof configuration.apiKey === "function" - ? await configuration.apiKey(keyParamName) - : await configuration.apiKey - object[keyParamName] = localVarApiKeyValue - } -} - -/** - * - * @export - */ -export const setBasicAuthToObject = function ( - object: any, - configuration?: Configuration, -) { - if (configuration && (configuration.username || configuration.password)) { - object["auth"] = { - username: configuration.username, - password: configuration.password, - } - } -} - -/** - * - * @export - */ -export const setBearerAuthToObject = async function ( - object: any, - configuration?: Configuration, -) { - if (configuration && configuration.accessToken) { - const accessToken = - typeof configuration.accessToken === "function" - ? await configuration.accessToken() - : await configuration.accessToken - object["Authorization"] = "Bearer " + accessToken - } -} - -/** - * - * @export - */ -export const setOAuthToObject = async function ( - object: any, - name: string, - scopes: string[], - configuration?: Configuration, -) { - if (configuration && configuration.accessToken) { - const localVarAccessTokenValue = - typeof configuration.accessToken === "function" - ? await configuration.accessToken(name, scopes) - : await configuration.accessToken - object["Authorization"] = "Bearer " + localVarAccessTokenValue - } -} - -function setFlattenedQueryParams( - urlSearchParams: URLSearchParams, - parameter: any, - key: string = "", -): void { - if (parameter == null) return - if (typeof parameter === "object") { - if (Array.isArray(parameter)) { - ;(parameter as any[]).forEach((item) => - setFlattenedQueryParams(urlSearchParams, item, key), - ) - } else { - Object.keys(parameter).forEach((currentKey) => - setFlattenedQueryParams( - urlSearchParams, - parameter[currentKey], - `${key}${key !== "" ? "." : ""}${currentKey}`, - ), - ) - } - } else { - if (urlSearchParams.has(key)) { - urlSearchParams.append(key, parameter) - } else { - urlSearchParams.set(key, parameter) - } - } -} - -/** - * - * @export - */ -export const setSearchParams = function (url: URL, ...objects: any[]) { - const searchParams = new URLSearchParams(url.search) - setFlattenedQueryParams(searchParams, objects) - url.search = searchParams.toString() -} - -/** - * - * @export - */ -export const serializeDataIfNeeded = function ( - value: any, - requestOptions: any, - configuration?: Configuration, -) { - const nonString = typeof value !== "string" - const needsSerialization = - nonString && configuration && configuration.isJsonMime - ? configuration.isJsonMime(requestOptions.headers["Content-Type"]) - : nonString - return needsSerialization - ? JSON.stringify(value !== undefined ? value : {}) - : value || "" -} - -/** - * - * @export - */ -export const toPathString = function (url: URL) { - return url.pathname + url.search + url.hash -} - -/** - * - * @export - */ -export const createRequestFunction = function ( - axiosArgs: RequestArgs, - globalAxios: AxiosInstance, - BASE_PATH: string, - configuration?: Configuration, -) { - return >( - axios: AxiosInstance = globalAxios, - basePath: string = BASE_PATH, - ) => { - const axiosRequestArgs = { - ...axiosArgs.options, - url: - (axios.defaults.baseURL ? "" : (configuration?.basePath ?? basePath)) + - axiosArgs.url, - } - return axios.request(axiosRequestArgs) - } -} diff --git a/frontend-demo/api/src/generated/v0/configuration.ts b/frontend-demo/api/src/generated/v0/configuration.ts deleted file mode 100644 index 43cdaf7..0000000 --- a/frontend-demo/api/src/generated/v0/configuration.ts +++ /dev/null @@ -1,132 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Learn AI API - * MIT public API - * - * The version of the OpenAPI document: 0.0.1 (v0) - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -export interface ConfigurationParameters { - apiKey?: - | string - | Promise - | ((name: string) => string) - | ((name: string) => Promise) - username?: string - password?: string - accessToken?: - | string - | Promise - | ((name?: string, scopes?: string[]) => string) - | ((name?: string, scopes?: string[]) => Promise) - basePath?: string - serverIndex?: number - baseOptions?: any - formDataCtor?: new () => any -} - -export class Configuration { - /** - * parameter for apiKey security - * @param name security name - * @memberof Configuration - */ - apiKey?: - | string - | Promise - | ((name: string) => string) - | ((name: string) => Promise) - /** - * parameter for basic security - * - * @type {string} - * @memberof Configuration - */ - username?: string - /** - * parameter for basic security - * - * @type {string} - * @memberof Configuration - */ - password?: string - /** - * parameter for oauth2 security - * @param name security name - * @param scopes oauth2 scope - * @memberof Configuration - */ - accessToken?: - | string - | Promise - | ((name?: string, scopes?: string[]) => string) - | ((name?: string, scopes?: string[]) => Promise) - /** - * override base path - * - * @type {string} - * @memberof Configuration - */ - basePath?: string - /** - * override server index - * - * @type {number} - * @memberof Configuration - */ - serverIndex?: number - /** - * base options for axios calls - * - * @type {any} - * @memberof Configuration - */ - baseOptions?: any - /** - * The FormData constructor that will be used to create multipart form data - * requests. You can inject this here so that execution environments that - * do not support the FormData class can still run the generated client. - * - * @type {new () => FormData} - */ - formDataCtor?: new () => any - - constructor(param: ConfigurationParameters = {}) { - this.apiKey = param.apiKey - this.username = param.username - this.password = param.password - this.accessToken = param.accessToken - this.basePath = param.basePath - this.serverIndex = param.serverIndex - this.baseOptions = param.baseOptions - this.formDataCtor = param.formDataCtor - } - - /** - * Check if the given MIME is a JSON MIME. - * JSON MIME examples: - * application/json - * application/json; charset=UTF8 - * APPLICATION/JSON - * application/vnd.company+json - * @param mime - MIME (Multipurpose Internet Mail Extensions) - * @return True if the given MIME is JSON, false otherwise. - */ - public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp( - "^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$", - "i", - ) - return ( - mime !== null && - (jsonMime.test(mime) || - mime.toLowerCase() === "application/json-patch+json") - ) - } -} diff --git a/frontend-demo/api/src/generated/v0/git_push.sh b/frontend-demo/api/src/generated/v0/git_push.sh deleted file mode 100644 index 2a805eb..0000000 --- a/frontend-demo/api/src/generated/v0/git_push.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 -git_host=$4 - -if [ "$git_host" = "" ]; then - git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" -fi - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo '[INFO] $GIT_TOKEN (environment variable) is not set. Using the git credential in your environment.' - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' diff --git a/frontend-demo/api/src/generated/v0/index.ts b/frontend-demo/api/src/generated/v0/index.ts deleted file mode 100644 index 466d7ac..0000000 --- a/frontend-demo/api/src/generated/v0/index.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* tslint:disable */ -/* eslint-disable */ -/** - * Learn AI API - * MIT public API - * - * The version of the OpenAPI document: 0.0.1 (v0) - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -export * from "./api" -export * from "./configuration" diff --git a/frontend-demo/package.json b/frontend-demo/package.json index 45054c0..8d119d0 100644 --- a/frontend-demo/package.json +++ b/frontend-demo/package.json @@ -52,10 +52,10 @@ "eslint-import-resolver-typescript": "^3.6.1", "eslint-plugin-import": "^2.29.1", "eslint-plugin-jest": "^28.6.0", - "eslint-plugin-mdx": "^3.1.5", + "eslint-plugin-mdx": "^3.0.0", "eslint-plugin-react": "^7.34.3", "eslint-plugin-react-hooks": "^4.6.2", - "eslint-plugin-styled-components-a11y": "^2.2.0", + "eslint-plugin-styled-components-a11y": "^2.1.35", "eslint-plugin-testing-library": "^6.2.0", "jest": "^29.7.0", "jest-environment-jsdom": "^29.5.0", diff --git a/frontend-demo/yarn.lock b/frontend-demo/yarn.lock index dc55716..effa18e 100644 --- a/frontend-demo/yarn.lock +++ b/frontend-demo/yarn.lock @@ -4524,7 +4524,7 @@ __metadata: languageName: node linkType: hard -"eslint-plugin-mdx@npm:^3.1.5": +"eslint-plugin-mdx@npm:^3.0.0": version: 3.1.5 resolution: "eslint-plugin-mdx@npm:3.1.5" dependencies: @@ -4588,7 +4588,7 @@ __metadata: languageName: node linkType: hard -"eslint-plugin-styled-components-a11y@npm:^2.2.0": +"eslint-plugin-styled-components-a11y@npm:^2.1.35": version: 2.2.0 resolution: "eslint-plugin-styled-components-a11y@npm:2.2.0" dependencies: @@ -9994,10 +9994,10 @@ __metadata: eslint-import-resolver-typescript: "npm:^3.6.1" eslint-plugin-import: "npm:^2.29.1" eslint-plugin-jest: "npm:^28.6.0" - eslint-plugin-mdx: "npm:^3.1.5" + eslint-plugin-mdx: "npm:^3.0.0" eslint-plugin-react: "npm:^7.34.3" eslint-plugin-react-hooks: "npm:^4.6.2" - eslint-plugin-styled-components-a11y: "npm:^2.2.0" + eslint-plugin-styled-components-a11y: "npm:^2.1.35" eslint-plugin-testing-library: "npm:^6.2.0" jest: "npm:^29.7.0" jest-environment-jsdom: "npm:^29.5.0" diff --git a/openapi/hooks.py b/openapi/hooks.py index ccc5a05..29d8105 100644 --- a/openapi/hooks.py +++ b/openapi/hooks.py @@ -70,121 +70,3 @@ def postprocess_x_enum_descriptions(result, generator, request, public): # noqa ] return result - - -def add_channels_routes(result, generator, request, public): # noqa: ARG001 - """ - Append ai_chatbots AsyncHttpConsumer endpoints to the OpenAPI schema. - """ - paths = result["paths"] - paths["/http/recommendation_agent/"] = { - "post": { - "operationId": "RecommendationAgentV0", - "description": "Recommendation agent endpoint via AsyncHttpConsumer", - "tags": ["Channels"], - "requestBody": { - "required": True, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "message": { - "type": "string", - "description": "The user's message to the AI", - }, - "model": { - "type": "string", - "description": "The LLM model to use", - }, - "temperature": { - "type": "number", - "format": "float", - "description": "The LLM temperature to use", - }, - "instructions": { - "type": "string", - "description": "System prompt (admins only)", - }, - "clear_history": { - "type": "boolean", - "description": "Whether to clear chat history", - }, - "thread_id": { - "type": "string", - "description": "The thread id to use", - }, - }, - "required": ["message"], - } - } - }, - }, - "responses": { - "200": { - "description": "Recommendation Agent stream", - "content": {"text/event-stream": {"schema": {"type": "string"}}}, - } - }, - } - } - paths["/http/syllabus_agent/"] = { - "post": { - "operationId": "SyllabusAgentV0", - "description": "Syllabus agent endpoint via AsyncHttpConsumer", - "tags": ["Channels"], - "requestBody": { - "required": True, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "message": { - "type": "string", - "description": "The user's message to the AI", - }, - "course_id": { - "type": "string", - "description": "The course id", - }, - "collection_name": { - "type": "string", - "description": "Vector embedding collection name", - }, - "model": { - "type": "string", - "description": "The LLM model to use", - }, - "temperature": { - "type": "number", - "format": "float", - "description": "The LLM temperature to use", - }, - "instructions": { - "type": "string", - "description": "System prompt (admins only)", - }, - "clear_history": { - "type": "boolean", - "description": "Whether to clear chat history", - }, - "thread_id": { - "type": "string", - "description": "The thread id to use", - }, - }, - "required": ["message", "course_id"], - } - } - }, - }, - "responses": { - "200": { - "description": "Recommendation Agent stream", - "content": {"text/event-stream": {"schema": {"type": "string"}}}, - } - }, - } - } - return result diff --git a/openapi/settings_spectacular.py b/openapi/settings_spectacular.py index b257491..b3e081d 100644 --- a/openapi/settings_spectacular.py +++ b/openapi/settings_spectacular.py @@ -13,7 +13,6 @@ "AUTHENTICATION_WHITELIST": [], "SCHEMA_PATH_PREFIX": "/api/v[0-9]", "POSTPROCESSING_HOOKS": [ - "openapi.hooks.add_channels_routes", "drf_spectacular.hooks.postprocess_schema_enums", "openapi.hooks.postprocess_x_enum_descriptions", ], diff --git a/openapi/specs/v0.yaml b/openapi/specs/v0.yaml index 64ef801..a42e59a 100644 --- a/openapi/specs/v0.yaml +++ b/openapi/specs/v0.yaml @@ -1,360 +1,6 @@ openapi: 3.0.3 info: - title: Learn AI API - version: 0.0.1 (v0) - description: MIT public API -paths: - /api/v0/chat_sessions/: - get: - operationId: chat_sessions_list - description: API endpoint that allows user session chats to be viewed or edited. - parameters: - - name: limit - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - name: offset - required: false - in: query - description: The initial index from which to return the results. - schema: - type: integer - - in: path - name: thread_id - schema: - type: string - description: thread id of the chat session - required: true - tags: - - chat_sessions - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedUserChatSessionList' - description: '' - post: - operationId: chat_sessions_create - description: API endpoint that allows user session chats to be viewed or edited. - parameters: - - in: path - name: thread_id - schema: - type: string - description: thread id of the chat session - required: true - tags: - - chat_sessions - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UserChatSessionRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/UserChatSessionRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/UserChatSessionRequest' - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/UserChatSession' - description: '' - /api/v0/chat_sessions/{thread_id}/: - get: - operationId: chat_sessions_retrieve - description: API endpoint that allows user session chats to be viewed or edited. - parameters: - - in: path - name: thread_id - schema: - type: string - description: thread id of the chat session - required: true - tags: - - chat_sessions - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/UserChatSession' - description: '' - patch: - operationId: chat_sessions_partial_update - description: API endpoint that allows user session chats to be viewed or edited. - parameters: - - in: path - name: thread_id - schema: - type: string - description: thread id of the chat session - required: true - tags: - - chat_sessions - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PatchedUserChatSessionRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/PatchedUserChatSessionRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/PatchedUserChatSessionRequest' - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/UserChatSession' - description: '' - delete: - operationId: chat_sessions_destroy - description: API endpoint that allows user session chats to be viewed or edited. - parameters: - - in: path - name: thread_id - schema: - type: string - description: thread id of the chat session - required: true - tags: - - chat_sessions - responses: - '204': - description: No response body - /api/v0/chat_sessions/{thread_id}/messages/: - get: - operationId: chat_sessions_messages_list - description: Read-only API endpoint for returning just human/agent chat messages - in a thread. - parameters: - - name: limit - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - name: offset - required: false - in: query - description: The initial index from which to return the results. - schema: - type: integer - - in: path - name: thread_id - schema: - type: string - description: thread id of the chat session - required: true - tags: - - chat_sessions - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedChatMessageList' - description: '' - /http/recommendation_agent/: - post: - operationId: RecommendationAgentV0 - description: Recommendation agent endpoint via AsyncHttpConsumer - tags: - - Channels - requestBody: - required: true - content: - application/json: - schema: - type: object - properties: - message: - type: string - description: The user's message to the AI - model: - type: string - description: The LLM model to use - temperature: - type: number - format: float - description: The LLM temperature to use - instructions: - type: string - description: System prompt (admins only) - clear_history: - type: boolean - description: Whether to clear chat history - thread_id: - type: string - description: The thread id to use - required: - - message - responses: - '200': - description: Recommendation Agent stream - content: - text/event-stream: - schema: - type: string - /http/syllabus_agent/: - post: - operationId: SyllabusAgentV0 - description: Syllabus agent endpoint via AsyncHttpConsumer - tags: - - Channels - requestBody: - required: true - content: - application/json: - schema: - type: object - properties: - message: - type: string - description: The user's message to the AI - course_id: - type: string - description: The course id - collection_name: - type: string - description: Vector embedding collection name - model: - type: string - description: The LLM model to use - temperature: - type: number - format: float - description: The LLM temperature to use - instructions: - type: string - description: System prompt (admins only) - clear_history: - type: boolean - description: Whether to clear chat history - thread_id: - type: string - description: The thread id to use - required: - - message - - course_id - responses: - '200': - description: Recommendation Agent stream - content: - text/event-stream: - schema: - type: string -components: - schemas: - ChatMessage: - type: object - description: |- - Serializer for chat messages. This serializer is used to return just the message, - content and role, and is intended to backfill chat history in a frontend UI. - properties: - checkpoint_id: - type: string - role: - type: string - content: - type: string - required: - - checkpoint_id - - content - - role - PaginatedChatMessageList: - type: object - required: - - count - - results - properties: - count: - type: integer - example: 123 - next: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?offset=400&limit=100 - previous: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?offset=200&limit=100 - results: - type: array - items: - $ref: '#/components/schemas/ChatMessage' - PaginatedUserChatSessionList: - type: object - required: - - count - - results - properties: - count: - type: integer - example: 123 - next: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?offset=400&limit=100 - previous: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?offset=200&limit=100 - results: - type: array - items: - $ref: '#/components/schemas/UserChatSession' - PatchedUserChatSessionRequest: - type: object - description: Serializer for user chat sessions - properties: - title: - type: string - maxLength: 255 - UserChatSession: - type: object - description: Serializer for user chat sessions - properties: - thread_id: - type: string - readOnly: true - title: - type: string - maxLength: 255 - user: - type: integer - readOnly: true - nullable: true - created_on: - type: string - format: date-time - readOnly: true - updated_on: - type: string - format: date-time - readOnly: true - required: - - created_on - - thread_id - - updated_on - - user - UserChatSessionRequest: - type: object - description: Serializer for user chat sessions - properties: - title: - type: string - maxLength: 255 + title: '' + version: 0.0.0 (v0) +paths: {} +components: {} diff --git a/renovate.json b/renovate.json index f46b72e..33afe04 100644 --- a/renovate.json +++ b/renovate.json @@ -3,7 +3,7 @@ "extends": ["local>mitodl/.github:renovate-config"], "packageRules": [ { - "matchFileNames": ["frontend-demo/learn_ai/package.json"], + "matchFileNames": ["frontends/learn_ai/package.json"], "matchUpdateTypes": ["major"], "enabled": false }, diff --git a/scripts/generate_openapi.sh b/scripts/generate_openapi.sh index e340872..562cc3d 100755 --- a/scripts/generate_openapi.sh +++ b/scripts/generate_openapi.sh @@ -23,5 +23,5 @@ docker run --rm -v "${PWD}:/local" -w /local openapitools/openapi-generator-cli: # We expect pre-commit to exit with a non-zero status since it is reformatting # the generated code. -git ls-files frontend-demo/api/src/generated | xargs pre-commit run --files || +git ls-files frontends/api/src/generated | xargs pre-commit run --files || echo "OpenAPI generation complete." diff --git a/scripts/openapi-configs/typescript-axios-v0.yaml b/scripts/openapi-configs/typescript-axios-v0.yaml index 7e0a0a1..b24c660 100644 --- a/scripts/openapi-configs/typescript-axios-v0.yaml +++ b/scripts/openapi-configs/typescript-axios-v0.yaml @@ -1,7 +1,7 @@ generatorName: typescript-axios -outputDir: frontend-demo/api/src/generated/v0 +outputDir: frontends/api/src/generated/v0 inputSpec: openapi/specs/v0.yaml -ignoreFileOverride: frontend-demo/api/.openapi-generator-ignore +ignoreFileOverride: frontends/api/.openapi-generator-ignore templateDir: scripts/openapi-configs/templates additionalProperties: paramNaming: original