Add support for submodules and fix file path in

.gitignore
This commit is contained in:
Stan Girard 2023-12-13 00:39:53 +01:00
parent 80e2c08d14
commit cad840203f
4 changed files with 17 additions and 3 deletions

View File

@ -14,6 +14,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: 'true'
- name: Install Vercel CLI
run: npm install --global vercel@latest
- name: Pull Vercel Environment Information

View File

@ -11,6 +11,7 @@ import {
import {
CreateBrainInput,
ListFilesProps,
SubscriptionUpdatableProperties,
UpdateBrainInput,
} from "./types";
@ -144,8 +145,8 @@ export const getDocsFromQuestion = async (
brainId: string,
question: string,
axiosInstance: AxiosInstance
): Promise<string[]> => {
return (await axiosInstance.post<Record<"docs",string[]>>(`/brains/${brainId}/documents`, {
): Promise<ListFilesProps["files"]> => {
return (await axiosInstance.post<Record<"docs",ListFilesProps["files"]>>(`/brains/${brainId}/documents`, {
question,
})).data.docs;
}

View File

@ -23,6 +23,17 @@ export type SubscriptionUpdatableProperties = {
role: BrainRoleType | null;
};
export type ListFilesProps = {
files: {
file_name: string;
file_sha1: string;
file_size: number;
file_url: string;
file_id: string;
file_similarity: number;
}[];
};
export type ApiBrainDefinitionSecret = {
name: string;
type: ApiBrainDefinitionSchemaPropertyType;