only_ever_generator 8.4.6 → 8.4.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bootstrap/app.d.ts +6 -3
- package/dist/bootstrap/app.d.ts.map +1 -1
- package/dist/bootstrap/app.js +11 -17
- package/dist/bootstrap/app.js.map +1 -1
- package/dist/card_gen/generate_cards.d.ts +2 -3
- package/dist/card_gen/generate_cards.d.ts.map +1 -1
- package/dist/card_gen/generate_cards.js +22 -15
- package/dist/card_gen/generate_cards.js.map +1 -1
- package/dist/constants/prompt_data.d.ts +4 -4
- package/dist/constants/prompt_data.js +302 -302
- package/dist/constants/prompts/card_gen_prompt.js +160 -160
- package/dist/constants/prompts/typology_prompt.js +131 -131
- package/dist/constants/source_data.d.ts +171 -171
- package/dist/constants/source_data.js +973 -973
- package/dist/embedding_generation/local_consolidation.js +104 -104
- package/dist/helper/build_concept_facts_schema.d.ts +42 -42
- package/dist/helper/build_concept_facts_schema.js +44 -44
- package/dist/helper/qdrant_db_methods.d.ts.map +1 -1
- package/dist/helper/schema_helper/build_card_schema.d.ts +1 -9
- package/dist/helper/schema_helper/build_card_schema.d.ts.map +1 -1
- package/dist/helper/schema_helper/build_card_schema.js +47 -50
- package/dist/helper/schema_helper/build_card_schema.js.map +1 -1
- package/dist/helper/schema_helper/build_concept_facts_schema.d.ts +1 -1
- package/dist/helper/schema_helper/build_concept_facts_schema.d.ts.map +1 -1
- package/dist/helper/schema_helper/build_concept_facts_schema.js +20 -5
- package/dist/helper/schema_helper/build_concept_facts_schema.js.map +1 -1
- package/dist/helper/schema_helper/build_summary_schema.d.ts +1 -1
- package/dist/helper/schema_helper/build_summary_schema.d.ts.map +1 -1
- package/dist/helper/schema_helper/build_summary_schema.js +18 -7
- package/dist/helper/schema_helper/build_summary_schema.js.map +1 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -9
- package/dist/index.js.map +1 -1
- package/dist/parse/response_format_card.d.ts +176 -176
- package/dist/parse/response_format_card.js +371 -371
- package/dist/parse/response_format_typology.d.ts +1 -1
- package/dist/parse/response_format_typology.js +46 -46
- package/dist/services/get_prompts.d.ts +8 -7
- package/dist/services/get_prompts.d.ts.map +1 -1
- package/dist/services/get_prompts.js +69 -21
- package/dist/services/get_prompts.js.map +1 -1
- package/dist/typology_gen/generate_concept_facts.d.ts +2 -3
- package/dist/typology_gen/generate_concept_facts.d.ts.map +1 -1
- package/dist/typology_gen/generate_concept_facts.js +25 -15
- package/dist/typology_gen/generate_concept_facts.js.map +1 -1
- package/dist/typology_gen/generate_typology.d.ts +2 -1
- package/dist/typology_gen/generate_typology.d.ts.map +1 -1
- package/dist/typology_gen/generate_typology.js +24 -13
- package/dist/typology_gen/generate_typology.js.map +1 -1
- package/dist/typology_gen/summarize.d.ts +2 -3
- package/dist/typology_gen/summarize.d.ts.map +1 -1
- package/dist/typology_gen/summarize.js +24 -13
- package/dist/typology_gen/summarize.js.map +1 -1
- package/package.json +39 -38
- package/src/bootstrap/app.ts +418 -416
- package/src/card_gen/generate_cards.ts +347 -345
- package/src/config.ts +11 -11
- package/src/constants/api_constants.ts +7 -7
- package/src/constants/prompts/card_gen_prompt.ts +164 -164
- package/src/constants/prompts/typology_prompt.ts +139 -139
- package/src/embedding_generation/consolidation/global_consolidation.ts +96 -96
- package/src/embedding_generation/consolidation/local_consolidation.ts +141 -141
- package/src/embedding_generation/consolidation/write_consolidated_data.ts +98 -98
- package/src/embedding_generation/generate_embeddings.ts +42 -42
- package/src/embedding_generation/parse_embedding_response.ts +31 -31
- package/src/enums/card_type_enum.ts +6 -6
- package/src/gap_fill/calculate_gap_fill.ts +50 -50
- package/src/helper/get_id_from_title.ts +33 -33
- package/src/helper/mongo_helper.ts +29 -29
- package/src/helper/openai_helper.ts +20 -20
- package/src/helper/qdrant_db_methods.ts +77 -77
- package/src/helper/schema_helper/build_card_schema.ts +74 -98
- package/src/helper/schema_helper/build_classify_summarize_schema.ts +43 -43
- package/src/helper/schema_helper/build_concept_facts_schema.ts +45 -31
- package/src/helper/schema_helper/build_summary_schema.ts +43 -32
- package/src/index.ts +71 -73
- package/src/logger.ts +65 -65
- package/src/parse/parse_card/parse_cloze_card.ts +146 -146
- package/src/parse/parse_card/parse_flash_cards.ts +42 -42
- package/src/parse/parse_card/parse_match_card.ts +104 -104
- package/src/parse/parse_card/parse_mcq_card.ts +114 -114
- package/src/parse/parse_card_response.ts +197 -197
- package/src/parse/parse_source_content.ts +212 -212
- package/src/services/get_prompts.ts +164 -112
- package/src/services/open_ai_service.ts +89 -89
- package/src/services/qdrant_service.ts +10 -10
- package/src/types/base_param_type.ts +13 -13
- package/src/types/mongo_concept_fact_type.ts +12 -12
- package/src/types/parsed_card_type.ts +39 -39
- package/src/types/raw_card_response_types/generated_card_response_type.ts +59 -59
- package/src/types/source_taxonomy_type.ts +24 -24
- package/src/typology-parsed-response.ts +1932 -1932
- package/src/typology_gen/generate_concept_facts.ts +180 -169
- package/src/typology_gen/generate_typology.ts +203 -189
- package/src/typology_gen/summarize.ts +176 -164
- package/src/utils/distributed_quote_restoration.ts +80 -80
- package/src/utils/generate_args.ts +29 -29
- package/src/utils/parse_openai_response.ts +19 -19
- package/src/utils/sanitize_strings.ts +65 -65
- package/tsconfig.json +16 -16
- package/dist/constants/default_generation_variables.d.ts +0 -3
- package/dist/constants/default_generation_variables.d.ts.map +0 -1
- package/dist/constants/default_generation_variables.js +0 -580
- package/dist/constants/default_generation_variables.js.map +0 -1
- package/dist/services/prompts_test.d.ts +0 -10
- package/dist/services/prompts_test.d.ts.map +0 -1
- package/dist/services/prompts_test.js +0 -227
- package/dist/services/prompts_test.js.map +0 -1
- package/dist/types/generation_variables_schema.d.ts +0 -14
- package/dist/types/generation_variables_schema.d.ts.map +0 -1
- package/dist/types/generation_variables_schema.js +0 -3
- package/dist/types/generation_variables_schema.js.map +0 -1
- package/dist/utils/test.d.ts +0 -2
- package/dist/utils/test.d.ts.map +0 -1
- package/dist/utils/test.js +0 -5
- package/dist/utils/test.js.map +0 -1
- package/src/constants/default_generation_variables.ts +0 -624
- package/src/types/generation_variables_schema.ts +0 -16
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
import { CardTypeEnum } from "../../enums/card_type_enum";
|
|
2
|
-
|
|
3
|
-
export type GeneratedCardResponseType = {
|
|
4
|
-
metadata: any;
|
|
5
|
-
generated_content: {
|
|
6
|
-
test_cards: RawTestCardResponseType[];
|
|
7
|
-
};
|
|
8
|
-
status_code: number;
|
|
9
|
-
usage_data: any;
|
|
10
|
-
generated_at: Date;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export type RawTestCardResponseType = {
|
|
14
|
-
type: string;
|
|
15
|
-
// type:
|
|
16
|
-
// | CardTypeEnum.FLASH
|
|
17
|
-
// | CardTypeEnum.MATCH
|
|
18
|
-
// | CardTypeEnum.MCQ
|
|
19
|
-
// | CardTypeEnum.CLOZE;
|
|
20
|
-
card_content:
|
|
21
|
-
| RawFlashCardResponseType
|
|
22
|
-
| RawMatchCardResponseType
|
|
23
|
-
| RawClozeCardResponseType
|
|
24
|
-
| RawMcqCardResponseType;
|
|
25
|
-
concepts: string[];
|
|
26
|
-
facts: string[];
|
|
27
|
-
explanation: string;
|
|
28
|
-
bloom_level: number;
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
export type RawFlashCardResponseType = {
|
|
32
|
-
front: string;
|
|
33
|
-
back: string;
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
export type RawMatchCardResponseType = {
|
|
37
|
-
left_item: string;
|
|
38
|
-
right_item: string;
|
|
39
|
-
}[];
|
|
40
|
-
|
|
41
|
-
export type RawClozeCardResponseType = {
|
|
42
|
-
correct_options: string[];
|
|
43
|
-
incorrect_options: string[];
|
|
44
|
-
prompt: string;
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
export type RawMcqCardResponseType = {
|
|
48
|
-
prompt: string;
|
|
49
|
-
choices: {
|
|
50
|
-
choice: string;
|
|
51
|
-
is_correct: boolean;
|
|
52
|
-
}[];
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
//
|
|
56
|
-
// flash : 1
|
|
57
|
-
// cloze 0,
|
|
58
|
-
// match 2
|
|
59
|
-
// mcq 3
|
|
1
|
+
import { CardTypeEnum } from "../../enums/card_type_enum";
|
|
2
|
+
|
|
3
|
+
export type GeneratedCardResponseType = {
|
|
4
|
+
metadata: any;
|
|
5
|
+
generated_content: {
|
|
6
|
+
test_cards: RawTestCardResponseType[];
|
|
7
|
+
};
|
|
8
|
+
status_code: number;
|
|
9
|
+
usage_data: any;
|
|
10
|
+
generated_at: Date;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export type RawTestCardResponseType = {
|
|
14
|
+
type: string;
|
|
15
|
+
// type:
|
|
16
|
+
// | CardTypeEnum.FLASH
|
|
17
|
+
// | CardTypeEnum.MATCH
|
|
18
|
+
// | CardTypeEnum.MCQ
|
|
19
|
+
// | CardTypeEnum.CLOZE;
|
|
20
|
+
card_content:
|
|
21
|
+
| RawFlashCardResponseType
|
|
22
|
+
| RawMatchCardResponseType
|
|
23
|
+
| RawClozeCardResponseType
|
|
24
|
+
| RawMcqCardResponseType;
|
|
25
|
+
concepts: string[];
|
|
26
|
+
facts: string[];
|
|
27
|
+
explanation: string;
|
|
28
|
+
bloom_level: number;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export type RawFlashCardResponseType = {
|
|
32
|
+
front: string;
|
|
33
|
+
back: string;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export type RawMatchCardResponseType = {
|
|
37
|
+
left_item: string;
|
|
38
|
+
right_item: string;
|
|
39
|
+
}[];
|
|
40
|
+
|
|
41
|
+
export type RawClozeCardResponseType = {
|
|
42
|
+
correct_options: string[];
|
|
43
|
+
incorrect_options: string[];
|
|
44
|
+
prompt: string;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export type RawMcqCardResponseType = {
|
|
48
|
+
prompt: string;
|
|
49
|
+
choices: {
|
|
50
|
+
choice: string;
|
|
51
|
+
is_correct: boolean;
|
|
52
|
+
}[];
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
//
|
|
56
|
+
// flash : 1
|
|
57
|
+
// cloze 0,
|
|
58
|
+
// match 2
|
|
59
|
+
// mcq 3
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
export type SourceTaxonomy = {
|
|
2
|
-
concepts_facts: {
|
|
3
|
-
text: string;
|
|
4
|
-
type: string;
|
|
5
|
-
/// will only be present temporarily and wont be stored in database
|
|
6
|
-
embedding?: number[];
|
|
7
|
-
reference: string;
|
|
8
|
-
}[];
|
|
9
|
-
fields: string[];
|
|
10
|
-
summary_cards: {
|
|
11
|
-
title: string;
|
|
12
|
-
text: string;
|
|
13
|
-
reference: string;
|
|
14
|
-
}[];
|
|
15
|
-
|
|
16
|
-
/// will only be present temporarily and wont be stored in database
|
|
17
|
-
metadata?: any[];
|
|
18
|
-
learn_value: {
|
|
19
|
-
value: number;
|
|
20
|
-
reason: string;
|
|
21
|
-
bloom_levels: any[];
|
|
22
|
-
bloom_levels_reason: string;
|
|
23
|
-
};
|
|
24
|
-
};
|
|
1
|
+
export type SourceTaxonomy = {
|
|
2
|
+
concepts_facts: {
|
|
3
|
+
text: string;
|
|
4
|
+
type: string;
|
|
5
|
+
/// will only be present temporarily and wont be stored in database
|
|
6
|
+
embedding?: number[];
|
|
7
|
+
reference: string;
|
|
8
|
+
}[];
|
|
9
|
+
fields: string[];
|
|
10
|
+
summary_cards: {
|
|
11
|
+
title: string;
|
|
12
|
+
text: string;
|
|
13
|
+
reference: string;
|
|
14
|
+
}[];
|
|
15
|
+
|
|
16
|
+
/// will only be present temporarily and wont be stored in database
|
|
17
|
+
metadata?: any[];
|
|
18
|
+
learn_value: {
|
|
19
|
+
value: number;
|
|
20
|
+
reason: string;
|
|
21
|
+
bloom_levels: any[];
|
|
22
|
+
bloom_levels_reason: string;
|
|
23
|
+
};
|
|
24
|
+
};
|