-
Notifications
You must be signed in to change notification settings - Fork 24
/
package_spec.json
2249 lines (2249 loc) · 119 KB
/
package_spec.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{
"modules": [
{
"name": "tanuki.assertion_visitor",
"path": "/Users/jackhopkins/PycharmProjects/monkeyFunctions/src/tanuki/assertion_visitor.py",
"classes": [
{
"name": "AssertionVisitor",
"type": "class",
"methods": [
{
"name": "__init__",
"parameters": "(self, scope: Optional[dict] = None, patch_symbolic_funcs: Dict[str, Callable] = {}, patch_embeddable_funcs: Dict[str, Callable] = {}, wrapper_alias='test_func')",
"returnType": "<class 'inspect._empty'>",
"docstring": "Initialize self. See help(type(self)) for accurate signature."
},
{
"name": "_eval_expr",
"parameters": "(self, node)",
"returnType": "<class 'inspect._empty'>",
"docstring": "No docstring"
},
{
"name": "_extract_args",
"parameters": "(self, node, iter_name=None)",
"returnType": "<class 'inspect._empty'>",
"docstring": "No docstring"
},
{
"name": "_generate_mock_embedding",
"parameters": "(self)",
"returnType": "<class 'inspect._empty'>",
"docstring": "No docstring"
},
{
"name": "_is_embeddable_function_call",
"parameters": "(self, node)",
"returnType": "<class 'inspect._empty'>",
"docstring": "No docstring"
},
{
"name": "_process_assert_helper",
"parameters": "(self, left, right, iter_name=None, op=None)",
"returnType": "<class 'inspect._empty'>",
"docstring": "This is a helper function for processing asserts. It is low-level and is called by higher-level functions\nthat analyze the AST of the aligned function.\n\nIt handles the case where both sides of the assert statement are patched embedding functions: where we need to\ndo special mocking.\n\nIt also handles the case where the left side of the assert statement is a patched symbolic function.\n\nArgs:\n left: The expression on the left of an assert statement\n right: The expression on the right of an assert statement\n iter_name: The name of the iterator variable (if any)\n op: The operator used in the assert statement (e.g. ast.Eq() for '==')"
},
{
"name": "_process_assert_helper_both_sides_embeddable",
"parameters": "(self, left, right, iter_name=None, op=None)",
"returnType": "<class 'inspect._empty'>",
"docstring": "No docstring"
},
{
"name": "_process_assert_helper_lr",
"parameters": "(self, left, right, iter_name=None, op=None)",
"returnType": "<class 'inspect._empty'>",
"docstring": "No docstring"
},
{
"name": "_process_assert_with_tuple",
"parameters": "(self, node, iter_names, evaluated_expr)",
"returnType": "<class 'inspect._empty'>",
"docstring": "No docstring"
},
{
"name": "extract_output",
"parameters": "(self, node, scope=None)",
"returnType": "<class 'inspect._empty'>",
"docstring": "No docstring"
},
{
"name": "get_value",
"parameters": "(self, node)",
"returnType": "<class 'inspect._empty'>",
"docstring": "No docstring"
},
{
"name": "instantiate",
"parameters": "(self, func, *args, **kwargs)",
"returnType": "<class 'inspect._empty'>",
"docstring": "Instantiate a function with the given arguments and keyword arguments."
},
{
"name": "load_variable_values",
"parameters": "(self, var_name)",
"returnType": "<class 'inspect._empty'>",
"docstring": "No docstring"
},
{
"name": "process_assert",
"parameters": "(self, node, iter_name=None, evaluated_expr=None)",
"returnType": "<class 'inspect._empty'>",
"docstring": "No docstring"
},
{
"name": "visit_Assert",
"parameters": "(self, node)",
"returnType": "<class 'inspect._empty'>",
"docstring": "No docstring"
},
{
"name": "visit_Assign",
"parameters": "(self, node)",
"returnType": "<class 'inspect._empty'>",
"docstring": "No docstring"
},
{
"name": "visit_For",
"parameters": "(self, node)",
"returnType": "<class 'inspect._empty'>",
"docstring": "No docstring"
},
{
"name": "visit_FunctionDef",
"parameters": "(self, node)",
"returnType": "<class 'inspect._empty'>",
"docstring": "No docstring"
},
{
"name": "visit_Import",
"parameters": "(self, node)",
"returnType": "<class 'inspect._empty'>",
"docstring": "No docstring"
},
{
"name": "visit_ImportFrom",
"parameters": "(self, node)",
"returnType": "<class 'inspect._empty'>",
"docstring": "No docstring"
}
],
"properties": [
{
"name": "generic_visit",
"type": "function",
"visibility": "public"
},
{
"name": "visit",
"type": "function",
"visibility": "public"
},
{
"name": "visit_Constant",
"type": "function",
"visibility": "public"
}
],
"docstring": "A node visitor base class that walks the abstract syntax tree and calls a\nvisitor function for every node found. This function may return a value\nwhich is forwarded by the `visit` method.\n\nThis class is meant to be subclassed, with the subclass adding visitor\nmethods.\n\nPer default the visitor functions for the nodes are ``'visit_'`` +\nclass name of the node. So a `TryFinally` node visit function would\nbe `visit_TryFinally`. This behavior can be changed by overriding\nthe `visit` method. If no visitor function exists for a node\n(return value `None`) the `generic_visit` visitor is used instead.\n\nDon't use the `NodeVisitor` if you want to apply changes to nodes during\ntraversing. For this a special visitor exists (`NodeTransformer`) that\nallows modifications."
},
{
"name": "Or",
"type": "class",
"methods": [],
"properties": [
{
"name": "append",
"type": "method_descriptor",
"visibility": "public"
},
{
"name": "clear",
"type": "method_descriptor",
"visibility": "public"
},
{
"name": "copy",
"type": "method_descriptor",
"visibility": "public"
},
{
"name": "count",
"type": "method_descriptor",
"visibility": "public"
},
{
"name": "extend",
"type": "method_descriptor",
"visibility": "public"
},
{
"name": "index",
"type": "method_descriptor",
"visibility": "public"
},
{
"name": "insert",
"type": "method_descriptor",
"visibility": "public"
},
{
"name": "pop",
"type": "method_descriptor",
"visibility": "public"
},
{
"name": "remove",
"type": "method_descriptor",
"visibility": "public"
},
{
"name": "reverse",
"type": "method_descriptor",
"visibility": "public"
},
{
"name": "sort",
"type": "method_descriptor",
"visibility": "public"
}
],
"docstring": "Built-in mutable sequence.\n\nIf no argument is given, the constructor creates a new empty list.\nThe argument must be an iterable if specified."
}
]
},
{
"name": "tanuki.bloom_filter",
"path": "/Users/jackhopkins/PycharmProjects/monkeyFunctions/src/tanuki/bloom_filter.py",
"classes": [
{
"name": "BloomFilter",
"type": "class",
"methods": [
{
"name": "__init__",
"parameters": "(self, persistence: tanuki.persistence.bloom_interface.IBloomFilterPersistence, size=None, hash_count=None, expected_number_of_elements=None, false_positive_probability=None)",
"returnType": "<class 'inspect._empty'>",
"docstring": "Initialize self. See help(type(self)) for accurate signature."
},
{
"name": "add",
"parameters": "(self, string)",
"returnType": "<class 'inspect._empty'>",
"docstring": "No docstring"
},
{
"name": "hash_functions",
"parameters": "(self, string)",
"returnType": "<class 'inspect._empty'>",
"docstring": "No docstring"
},
{
"name": "init_bit_array",
"parameters": "(self, size)",
"returnType": "<class 'inspect._empty'>",
"docstring": "No docstring"
},
{
"name": "load",
"parameters": "(self)",
"returnType": "<class 'inspect._empty'>",
"docstring": "No docstring"
},
{
"name": "lookup",
"parameters": "(self, string)",
"returnType": "<class 'inspect._empty'>",
"docstring": "No docstring"
},
{
"name": "optimal_bloom_filter_params",
"parameters": "(n, p)",
"returnType": "<class 'inspect._empty'>",
"docstring": "Calculate the optimal bit array size (m) and number of hash functions (k)\nfor a Bloom filter.\n\nn: expected number of items to be stored\np: acceptable false positive probability\n\nReturns a tuple (m, k)"
},
{
"name": "save",
"parameters": "(self)",
"returnType": "<class 'inspect._empty'>",
"docstring": "No docstring"
}
],
"properties": [],
"docstring": "No docstring"
}
]
},
{
"name": "tanuki.constants",
"path": "/Users/jackhopkins/PycharmProjects/monkeyFunctions/src/tanuki/constants.py",
"classes": []
},
{
"name": "tanuki.function_modeler",
"path": "/Users/jackhopkins/PycharmProjects/monkeyFunctions/src/tanuki/function_modeler.py",
"classes": [
{
"name": "FunctionModeler",
"type": "class",
"methods": [
{
"name": "__init__",
"parameters": "(self, data_worker: tanuki.trackers.dataset_worker.DatasetWorker, environment_id=0, api_providers: Dict[str, tanuki.language_models.llm_finetune_api_abc.LLM_Finetune_API] = None) -> None",
"returnType": "None",
"docstring": "Initialize self. See help(type(self)) for accurate signature."
},
{
"name": "_check_finetuning_condition",
"parameters": "(self, func_hash)",
"returnType": "<class 'inspect._empty'>",
"docstring": "Check if the finetuning condition is met\nCurrently finetuning condition is dependent on the number of symbolic datapoints since last finetuning"
},
{
"name": "_check_finetuning_status",
"parameters": "(self, func_hash)",
"returnType": "<class 'inspect._empty'>",
"docstring": "Check the status of the current finetuning job\nIf the job is finished, update the config file to reflect the new model"
},
{
"name": "_check_for_finetunes",
"parameters": "(self, function_description: tanuki.models.function_description.FunctionDescription) -> Tuple[bool, Dict]",
"returnType": "typing.Tuple[bool, typing.Dict]",
"docstring": "No docstring"
},
{
"name": "_construct_config_from_finetune",
"parameters": "(self, finetune_hash, finetune: tanuki.models.finetune_job.FinetuneJob)",
"returnType": "<class 'inspect._empty'>",
"docstring": "No docstring"
},
{
"name": "_execute_finetuning",
"parameters": "(self, function_description, func_hash)",
"returnType": "<class 'inspect._empty'>",
"docstring": "Execute the finetuning\nFirst create the OpenAI compatible dataset with jsonL file and upload it\nThen submit the OpenAI finetuning job\nFinally update the config file to reflect the new finetuning job as current"
},
{
"name": "_get_dataset_info",
"parameters": "(self, dataset_type, func_hash, type='length')",
"returnType": "<class 'inspect._empty'>",
"docstring": "Get the dataset size for a function hash"
},
{
"name": "_get_datasets",
"parameters": "(self)",
"returnType": "<class 'inspect._empty'>",
"docstring": "Get the existing datasets from the data worker"
},
{
"name": "_get_examples_from_alignment_buffer",
"parameters": "(self, buffer, max=20)",
"returnType": "<class 'inspect._empty'>",
"docstring": "Get examples from a buffer"
},
{
"name": "_save_contrastive_alignment_pair",
"parameters": "(self, function_hash: str, args, kwargs, pair, positive=True)",
"returnType": "<class 'inspect._empty'>",
"docstring": "Save a contrastive pair"
},
{
"name": "_update_config_file",
"parameters": "(self, func_hash)",
"returnType": "<class 'inspect._empty'>",
"docstring": "No docstring"
},
{
"name": "_update_datapoint_config",
"parameters": "(self, repaired, func_hash)",
"returnType": "<class 'inspect._empty'>",
"docstring": "Update the config to reflect the new datapoint in the training data\nFirst adds 1 to the current datapoints\nThen updates running faults depending if priority is True or not and takes last 100\nThen checks the revert condition, i.e if last 10 datapoints are 50% faulty\nFinally updates the config file \nArgs:\n priority (bool): whether the datapoint was fixed by the teacher model/should be added to the training data"
},
{
"name": "_update_finetune_config",
"parameters": "(self, response: tanuki.models.finetune_job.FinetuneJob, func_hash, status)",
"returnType": "<class 'inspect._empty'>",
"docstring": "Update the config file to reflect the new model and switch the current model to the finetuned model"
},
{
"name": "check_for_finetuning",
"parameters": "(self, function_description, func_hash)",
"returnType": "<class 'inspect._empty'>",
"docstring": "Check for finetuning status\nIf already finetuning, check for finetuning status\nIf not finetuning, check for finetuning condition and execute finetuning if condition is met"
},
{
"name": "get_embeddable_alignments",
"parameters": "(self, func_hash, max=20)",
"returnType": "<class 'inspect._empty'>",
"docstring": "Get all embeddable aligns for a function hash"
},
{
"name": "get_models",
"parameters": "(self, function_description)",
"returnType": "<class 'inspect._empty'>",
"docstring": "Return the current model from the config file"
},
{
"name": "get_symbolic_alignments",
"parameters": "(self, func_hash, max=20)",
"returnType": "<class 'inspect._empty'>",
"docstring": "Get all symbolic aligns for a function hash"
},
{
"name": "load_function_config",
"parameters": "(self, func_hash, function_description)",
"returnType": "<class 'inspect._empty'>",
"docstring": "Load the config file for a function hash"
},
{
"name": "load_symbolic_align_statements",
"parameters": "(self, function_hash)",
"returnType": "<class 'inspect._empty'>",
"docstring": "Load all align statements\nFirst check the data storage blacklist,\nif the func hash is in the blacklist, then set the dataset size to 0 and the align buffer to empty bytearray"
},
{
"name": "postprocess_symbolic_datapoint",
"parameters": "(self, func_hash, function_description, example, repaired=True)",
"returnType": "<class 'inspect._empty'>",
"docstring": "Postprocess the datapoint\nFirst check if the datapoint should be added to the training data\nAdd the datapoint if it should be added\nThen check if the function should be finetuned and execute finetuning if it should"
},
{
"name": "save_embeddable_align_statements",
"parameters": "(self, function_hash: str, args, kwargs, positive_pairs: List[Tuple[List, Dict]], negative_pairs: List[Tuple[List, Dict]])",
"returnType": "<class 'inspect._empty'>",
"docstring": "Save the contrastive align statements for the embeddable function.\nDo not save if the function hash is in the store data blacklist\n\nArgs:\n function_hash: A unique hash for the function\n args: The arguments of the function\n kwargs: The keyword arguments of the function\n positive_pairs: A list of the other function invocations that are should have equivalent embeddings\n negative_pairs: A list of the other function invocations that are should have different embeddings"
},
{
"name": "save_symbolic_align_statements",
"parameters": "(self, function_hash, args, kwargs, output)",
"returnType": "<class 'inspect._empty'>",
"docstring": "Save the align statements and add to the align buffer\nDo not save if the function hash is in the store data blacklist\nThen just add the datapoints to the align buffer"
},
{
"name": "save_symbolic_datapoint",
"parameters": "(self, func_hash, example)",
"returnType": "<class 'inspect._empty'>",
"docstring": "Save datapoint to the training data"
}
],
"properties": [],
"docstring": "This class manages the registered function models and their datasets\ncomprised of symbolic and embeddable alignments, and symbolic and embeddable patches"
}
]
},
{
"name": "tanuki.language_models",
"path": "/Users/jackhopkins/PycharmProjects/monkeyFunctions/src/tanuki/language_models/__init__.py",
"classes": []
},
{
"name": "tanuki.language_models.embedding_api_abc",
"path": "/Users/jackhopkins/PycharmProjects/monkeyFunctions/src/tanuki/language_models/embedding_api_abc.py",
"classes": [
{
"name": "Embedding_API",
"type": "interface",
"methods": [
{
"name": "__init__",
"parameters": "(self) -> None",
"returnType": "None",
"docstring": "Initialize self. See help(type(self)) for accurate signature."
},
{
"name": "embed",
"parameters": "(self, texts: List[str], model: str = None, **kwargs) -> List[tanuki.models.embedding.Embedding]",
"returnType": "typing.List[tanuki.models.embedding.Embedding]",
"docstring": "The main embedding function, given the model and prompt, return a vector representation"
}
],
"properties": [],
"docstring": "Helper class that provides a standard way to create an ABC using\ninheritance."
}
]
},
{
"name": "tanuki.language_models.embedding_model_manager",
"path": "/Users/jackhopkins/PycharmProjects/monkeyFunctions/src/tanuki/language_models/embedding_model_manager.py",
"classes": [
{
"name": "EmbeddingModelManager",
"type": "class",
"methods": [
{
"name": "__call__",
"parameters": "(self, args, function_description, kwargs) -> tanuki.models.embedding.Embedding",
"returnType": "<class 'tanuki.models.embedding.Embedding'>",
"docstring": "Call self as a function."
},
{
"name": "__init__",
"parameters": "(self, function_modeler, api_providers: Dict[str, tanuki.language_models.embedding_api_abc.Embedding_API] = None)",
"returnType": "<class 'inspect._empty'>",
"docstring": "Initialize self. See help(type(self)) for accurate signature."
},
{
"name": "get_embedding_case",
"parameters": "(self, args, function_description: tanuki.models.function_description.FunctionDescription, kwargs, examples=None)",
"returnType": "<class 'inspect._empty'>",
"docstring": "No docstring"
}
],
"properties": [],
"docstring": "No docstring"
}
]
},
{
"name": "tanuki.language_models.language_model_manager",
"path": "/Users/jackhopkins/PycharmProjects/monkeyFunctions/src/tanuki/language_models/language_model_manager.py",
"classes": [
{
"name": "LanguageModelManager",
"type": "class",
"methods": [
{
"name": "__call__",
"parameters": "(self, args, function_description: tanuki.models.function_description.FunctionDescription, kwargs, validator: tanuki.validator.Validator) -> Any",
"returnType": "typing.Any",
"docstring": "Call self as a function."
},
{
"name": "__init__",
"parameters": "(self, function_modeler: tanuki.function_modeler.FunctionModeler, generation_token_limit=512, api_providers: Dict[str, tanuki.language_models.llm_api_abc.LLM_API] = None) -> None",
"returnType": "None",
"docstring": "Initialize self. See help(type(self)) for accurate signature."
},
{
"name": "_get_distillation_model_type",
"parameters": "(self, model)",
"returnType": "<class 'inspect._empty'>",
"docstring": "Get the distilled model type given the model"
},
{
"name": "_get_teacher_model_type",
"parameters": "(self, model)",
"returnType": "<class 'inspect._empty'>",
"docstring": "Get the teacher model type given the model"
},
{
"name": "_parse_choice",
"parameters": "(self, output)",
"returnType": "<class 'inspect._empty'>",
"docstring": "No docstring"
},
{
"name": "_synthesise_answer",
"parameters": "(self, prompt, model, model_type, llm_parameters)",
"returnType": "<class 'inspect._empty'>",
"docstring": "Synthesise an answer given the prompt, model, model_type and llm_parameters"
},
{
"name": "choose_model_from_tokens",
"parameters": "(self, models, token_count)",
"returnType": "<class 'inspect._empty'>",
"docstring": "Choose a model from the models given the token count"
},
{
"name": "construct_prompt",
"parameters": "(self, f, args, kwargs, examples)",
"returnType": "<class 'inspect._empty'>",
"docstring": "Cosntruct a prompt given the function description, args, kwargs and examples"
},
{
"name": "generate",
"parameters": "(self, args, kwargs, function_description, llm_parameters={})",
"returnType": "<class 'inspect._empty'>",
"docstring": "The main generation function, given the args, kwargs, function description and model type, generate a response and check if the datapoint can be saved to the finetune dataset"
},
{
"name": "generate_repair_prompt",
"parameters": "(self, args, kwargs, f, failed_outputs_list, examples)",
"returnType": "<class 'inspect._empty'>",
"docstring": "Generate a repair prompt given the args, kwargs, function description, failed outputs list and examples"
},
{
"name": "get_generation_case",
"parameters": "(self, args, kwargs, function_description)",
"returnType": "<class 'inspect._empty'>",
"docstring": "Get the generation case with the correct prompt and model\nFirst get the current model, then if distilled model, do zero-shot prompt and return False as suitable_for_finetune\nIf not distilled model, check if suitable for finetuning, create the prompt and return the correct model given the token count"
},
{
"name": "repair_generate",
"parameters": "(self, args, kwargs, f, failed_outputs_list, examples, models)",
"returnType": "<class 'inspect._empty'>",
"docstring": "Repair the output given the input, function description, failed outputs list, examples and models"
},
{
"name": "repair_output",
"parameters": "(self, args: tuple, kwargs: dict, function_description: tanuki.models.function_description.FunctionDescription, choice, validator: tanuki.validator.Validator) -> tuple",
"returnType": "<class 'tuple'>",
"docstring": "Repair an output, that failed type validation by generating a new output using the teacher model and the error\nArgs:\n args (tuple): The args of the function\n kwargs (dict): The kwargs of the function\n function_description (FunctionDescription): The function description\n choice: The output that failed type validation, type is arbitrary\n validator (Validator): The validator object\n\nReturns:\n choice (str): The choice that was generated by the language model\n choice_parsed: The parsed choice, type is arbitrary\n valid (bool): Whether the output was correctly repaired was valid"
},
{
"name": "suitable_for_finetuning_token_check",
"parameters": "(self, args, kwargs, f, distillation_token_count)",
"returnType": "<class 'inspect._empty'>",
"docstring": "Check if the inputs are suitable for finetuning, i.e are below the finetuning token count"
}
],
"properties": [],
"docstring": "The LanguageModelManager is responsible for managing the language models and their outputs operationally,\nthis includes:\n- Generating outputs from the language models\n- Repairing outputs from the language models\n- Saving outputs from the language models\n- Finetuning the language models from the saved outputs"
}
]
},
{
"name": "tanuki.language_models.llm_api_abc",
"path": "/Users/jackhopkins/PycharmProjects/monkeyFunctions/src/tanuki/language_models/llm_api_abc.py",
"classes": [
{
"name": "LLM_API",
"type": "interface",
"methods": [
{
"name": "__init__",
"parameters": "(self) -> None",
"returnType": "None",
"docstring": "Initialize self. See help(type(self)) for accurate signature."
},
{
"name": "generate",
"parameters": "(self, model, system_message, prompt, **kwargs)",
"returnType": "<class 'inspect._empty'>",
"docstring": "The main generation function, given the args, kwargs, function_modeler, function description and model type, generate a response and check if the datapoint can be saved to the finetune dataset"
}
],
"properties": [],
"docstring": "Helper class that provides a standard way to create an ABC using\ninheritance."
}
]
},
{
"name": "tanuki.language_models.llm_finetune_api_abc",
"path": "/Users/jackhopkins/PycharmProjects/monkeyFunctions/src/tanuki/language_models/llm_finetune_api_abc.py",
"classes": [
{
"name": "LLM_Finetune_API",
"type": "interface",
"methods": [
{
"name": "__init__",
"parameters": "(self) -> None",
"returnType": "None",
"docstring": "Initialize self. See help(type(self)) for accurate signature."
},
{
"name": "finetune",
"parameters": "(self, **kwargs) -> tanuki.models.finetune_job.FinetuneJob",
"returnType": "<class 'tanuki.models.finetune_job.FinetuneJob'>",
"docstring": "Creates a fine-tuning run\nArgs:\n **kwargs: \n\nReturns:"
},
{
"name": "get_finetuned",
"parameters": "(self, job_id: str, **kwargs) -> tanuki.models.finetune_job.FinetuneJob",
"returnType": "<class 'tanuki.models.finetune_job.FinetuneJob'>",
"docstring": "Gets a fine-tuning run by id"
},
{
"name": "list_finetuned",
"parameters": "(self, limit=100, **kwargs) -> List[tanuki.models.finetune_job.FinetuneJob]",
"returnType": "typing.List[tanuki.models.finetune_job.FinetuneJob]",
"docstring": "Gets the last N fine-tuning runs"
}
],
"properties": [],
"docstring": "Helper class that provides a standard way to create an ABC using\ninheritance."
}
]
},
{
"name": "tanuki.language_models.openai_api",
"path": "/Users/jackhopkins/PycharmProjects/monkeyFunctions/src/tanuki/language_models/openai_api.py",
"classes": [
{
"name": "OpenAI_API",
"type": "class",
"methods": [
{
"name": "__init__",
"parameters": "(self) -> None",
"returnType": "None",
"docstring": "Initialize self. See help(type(self)) for accurate signature."
},
{
"name": "check_api_key",
"parameters": "(self)",
"returnType": "<class 'inspect._empty'>",
"docstring": "No docstring"
},
{
"name": "embed",
"parameters": "(self, texts: List[str], model='text-similarity-babbage-001', **kwargs) -> List[tanuki.models.embedding.Embedding]",
"returnType": "typing.List[tanuki.models.embedding.Embedding]",
"docstring": "Generate embeddings for the provided texts using the specified OpenAI model.\nLightweight wrapper over the OpenAI client.\n\n:param texts: A list of texts to embed.\n:param model: The model to use for embeddings.\n:return: A list of embeddings."
},
{
"name": "finetune",
"parameters": "(self, file, suffix, **kwargs) -> tanuki.models.finetune_job.FinetuneJob",
"returnType": "<class 'tanuki.models.finetune_job.FinetuneJob'>",
"docstring": "Creates a fine-tuning run\nArgs:\n **kwargs: \n\nReturns:"
},
{
"name": "generate",
"parameters": "(self, model, system_message, prompt, **kwargs)",
"returnType": "<class 'inspect._empty'>",
"docstring": "The main generation function, given the args, kwargs, function_modeler, function description and model type, generate a response and check if the datapoint can be saved to the finetune dataset"
},
{
"name": "get_finetuned",
"parameters": "(self, job_id)",
"returnType": "<class 'inspect._empty'>",
"docstring": "Gets a fine-tuning run by id"
},
{
"name": "list_finetuned",
"parameters": "(self, limit=100, **kwargs) -> List[tanuki.models.finetune_job.FinetuneJob]",
"returnType": "typing.List[tanuki.models.finetune_job.FinetuneJob]",
"docstring": "Gets the last N fine-tuning runs"
}
],
"properties": [],
"docstring": "Helper class that provides a standard way to create an ABC using\ninheritance."
}
]
},
{
"name": "tanuki.models",
"path": "/Users/jackhopkins/PycharmProjects/monkeyFunctions/src/tanuki/models/__init__.py",
"classes": []
},
{
"name": "tanuki.models.embedding",
"path": "/Users/jackhopkins/PycharmProjects/monkeyFunctions/src/tanuki/models/embedding.py",
"classes": [
{
"name": "Embedding",
"type": "class",
"methods": [
{
"name": "__getattr__",
"parameters": "(self, item)",
"returnType": "<class 'inspect._empty'>",
"docstring": "No docstring"
},
{
"name": "__init__",
"parameters": "(self, data: List[float])",
"returnType": "<class 'inspect._empty'>",
"docstring": "Initialize self. See help(type(self)) for accurate signature."
},
{
"name": "__repr__",
"parameters": "(self)",
"returnType": "<class 'inspect._empty'>",
"docstring": "Return repr(self)."
},
{
"name": "__str__",
"parameters": "(self)",
"returnType": "<class 'inspect._empty'>",
"docstring": "Return str(self)."
}
],
"properties": [],
"docstring": "Abstract base class for generic types.\n\nA generic type is typically declared by inheriting from\nthis class parameterized with one or more type variables.\nFor example, a generic mapping type might be defined as::\n\n class Mapping(Generic[KT, VT]):\n def __getitem__(self, key: KT) -> VT:\n ...\n # Etc.\n\nThis class can then be used as follows::\n\n def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT:\n try:\n return mapping[key]\n except KeyError:\n return default"
}
]
},
{
"name": "tanuki.models.embedding_model_output",
"path": "/Users/jackhopkins/PycharmProjects/monkeyFunctions/src/tanuki/models/embedding_model_output.py",
"classes": [
{
"name": "EmbeddingModelOutput",
"type": "class",
"methods": [
{
"name": "__eq__",
"parameters": "(self, other)",
"returnType": "<class 'inspect._empty'>",
"docstring": "Return self==value."
},
{
"name": "__init__",
"parameters": "(self, generated_response: tanuki.models.embedding.Embedding, distilled_model: bool) -> None",
"returnType": "None",
"docstring": "Initialize self. See help(type(self)) for accurate signature."
},
{
"name": "__repr__",
"parameters": "(self)",
"returnType": "<class 'inspect._empty'>",
"docstring": "Return repr(self)."
}
],
"properties": [],
"docstring": "EmbeddingModelOutput(generated_response: tanuki.models.embedding.Embedding, distilled_model: bool)"
}
]
},
{
"name": "tanuki.models.finetune_job",
"path": "/Users/jackhopkins/PycharmProjects/monkeyFunctions/src/tanuki/models/finetune_job.py",
"classes": [
{
"name": "FinetuneJob",
"type": "class",
"methods": [
{
"name": "__eq__",
"parameters": "(self, other)",
"returnType": "<class 'inspect._empty'>",
"docstring": "Return self==value."
},
{
"name": "__init__",
"parameters": "(self, id: str, status: str, fine_tuned_model: str) -> None",
"returnType": "None",
"docstring": "Initialize self. See help(type(self)) for accurate signature."
},
{
"name": "__repr__",
"parameters": "(self)",
"returnType": "<class 'inspect._empty'>",
"docstring": "Return repr(self)."
}
],
"properties": [],
"docstring": "FinetuneJob(id: str, status: str, fine_tuned_model: str)"
}
]
},
{
"name": "tanuki.models.function_description",
"path": "/Users/jackhopkins/PycharmProjects/monkeyFunctions/src/tanuki/models/function_description.py",
"classes": [
{
"name": "FunctionDescription",
"type": "class",
"methods": [
{
"name": "__delattr__",
"parameters": "(self, name)",
"returnType": "<class 'inspect._empty'>",
"docstring": "Implement delattr(self, name)."
},
{
"name": "__eq__",
"parameters": "(self, other)",
"returnType": "<class 'inspect._empty'>",
"docstring": "Return self==value."
},
{
"name": "__hash__",
"parameters": "(self, purpose: str = 'general')",
"returnType": "<class 'inspect._empty'>",
"docstring": "Return hash(self)."
},
{
"name": "__init__",
"parameters": "(self, name: str, docstring: str, input_type_hints: Dict[str, type], input_class_definitions: Dict[str, str], output_type_hint: type, output_class_definition: Optional[str], type: tanuki.models.function_type.FunctionType = <FunctionType.SYMBOLIC: 'symbolic'>) -> None",
"returnType": "None",
"docstring": "Initialize self. See help(type(self)) for accurate signature."
},
{
"name": "__repr__",
"parameters": "(self)",
"returnType": "<class 'inspect._empty'>",
"docstring": "Return repr(self)."
},
{
"name": "__setattr__",
"parameters": "(self, name, value)",
"returnType": "<class 'inspect._empty'>",
"docstring": "Implement setattr(self, name, value)."
}
],
"properties": [
{
"name": "type",
"type": "FunctionType",
"visibility": "public"
}
],
"docstring": "FunctionDescription(name: str, docstring: str, input_type_hints: Dict[str, type], input_class_definitions: Dict[str, str], output_type_hint: type, output_class_definition: Optional[str], type: tanuki.models.function_type.FunctionType = <FunctionType.SYMBOLIC: 'symbolic'>)"
}
]
},
{
"name": "tanuki.models.function_example",
"path": "/Users/jackhopkins/PycharmProjects/monkeyFunctions/src/tanuki/models/function_example.py",
"classes": [
{
"name": "FunctionExample",
"type": "class",
"methods": [
{
"name": "__delattr__",
"parameters": "(self, name)",
"returnType": "<class 'inspect._empty'>",
"docstring": "Implement delattr(self, name)."
},
{
"name": "__eq__",
"parameters": "(self, other)",
"returnType": "<class 'inspect._empty'>",
"docstring": "Return self==value."
},
{
"name": "__hash__",
"parameters": "(self)",
"returnType": "<class 'inspect._empty'>",
"docstring": "Return hash(self)."
},
{
"name": "__init__",
"parameters": "(self, args: tuple, kwargs: dict, output: Any) -> None",
"returnType": "None",
"docstring": "Initialize self. See help(type(self)) for accurate signature."
},
{
"name": "__repr__",
"parameters": "(self)",
"returnType": "<class 'inspect._empty'>",
"docstring": "Return repr(self)."
},
{
"name": "__setattr__",
"parameters": "(self, name, value)",
"returnType": "<class 'inspect._empty'>",
"docstring": "Implement setattr(self, name, value)."
}
],
"properties": [],
"docstring": "FunctionExample(args: tuple, kwargs: dict, output: Any)"
}
]
},
{
"name": "tanuki.models.function_type",
"path": "/Users/jackhopkins/PycharmProjects/monkeyFunctions/src/tanuki/models/function_type.py",
"classes": [
{
"name": "FunctionType",
"type": "class",
"methods": [],
"properties": [
{
"name": "EMBEDDABLE",
"type": "FunctionType",
"visibility": "public"
},
{
"name": "SYMBOLIC",
"type": "FunctionType",
"visibility": "public"
},
{
"name": "capitalize",
"type": "method_descriptor",
"visibility": "public"
},
{
"name": "casefold",
"type": "method_descriptor",
"visibility": "public"
},
{
"name": "center",
"type": "method_descriptor",
"visibility": "public"
},
{
"name": "count",
"type": "method_descriptor",
"visibility": "public"
},
{
"name": "encode",
"type": "method_descriptor",
"visibility": "public"
},
{
"name": "endswith",
"type": "method_descriptor",
"visibility": "public"
},
{
"name": "expandtabs",
"type": "method_descriptor",
"visibility": "public"
},
{
"name": "find",
"type": "method_descriptor",
"visibility": "public"
},
{
"name": "format",
"type": "method_descriptor",
"visibility": "public"
},
{
"name": "format_map",
"type": "method_descriptor",
"visibility": "public"
},
{
"name": "index",
"type": "method_descriptor",