objectiveai 1.0.2 → 1.1.0
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/index.cjs +93 -619
- package/dist/index.d.ts +130 -478
- package/dist/index.js +92 -618
- package/package.json +8 -7
package/dist/index.d.ts
CHANGED
|
@@ -61,7 +61,7 @@ export declare namespace Chat {
|
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
-
type ReasoningEffort = "low" | "medium" | "high";
|
|
64
|
+
type ReasoningEffort = "minimal" | "low" | "medium" | "high";
|
|
65
65
|
type ResponseFormat = ResponseFormat.Text | ResponseFormat.JsonObject | ResponseFormat.JsonSchema;
|
|
66
66
|
namespace ResponseFormat {
|
|
67
67
|
interface Text {
|
|
@@ -503,23 +503,18 @@ export declare namespace Chat {
|
|
|
503
503
|
function create(openai: OpenAI, body: Request.ChatCompletionCreateParamsNonStreaming, options?: OpenAI.RequestOptions): Promise<Response.Unary.ChatCompletion>;
|
|
504
504
|
}
|
|
505
505
|
}
|
|
506
|
-
export declare namespace
|
|
506
|
+
export declare namespace Score {
|
|
507
507
|
namespace Completions {
|
|
508
508
|
namespace Request {
|
|
509
509
|
interface ChatCompletionCreateParamsBase {
|
|
510
510
|
messages: Chat.Completions.Request.Message[];
|
|
511
511
|
model: Model;
|
|
512
|
-
logprobs?: boolean | null;
|
|
513
|
-
n?: number | null;
|
|
514
|
-
prediction?: Chat.Completions.Request.Prediction | null;
|
|
515
|
-
response_format?: Chat.Completions.Request.ResponseFormat | null;
|
|
516
512
|
seed?: number | null;
|
|
517
513
|
service_tier?: Chat.Completions.Request.ServiceTier | null;
|
|
518
514
|
stream_options?: Chat.Completions.Request.StreamOptions | null;
|
|
519
515
|
tools?: Chat.Completions.Request.Tool[] | null;
|
|
520
|
-
top_logprobs?: number | null;
|
|
521
516
|
usage?: Chat.Completions.Request.Usage | null;
|
|
522
|
-
|
|
517
|
+
choices: string[];
|
|
523
518
|
}
|
|
524
519
|
interface ChatCompletionCreateParamsStreaming extends ChatCompletionCreateParamsBase {
|
|
525
520
|
stream: true;
|
|
@@ -528,7 +523,7 @@ export declare namespace Query {
|
|
|
528
523
|
stream?: false | null;
|
|
529
524
|
}
|
|
530
525
|
type ChatCompletionCreateParams = ChatCompletionCreateParamsStreaming | ChatCompletionCreateParamsNonStreaming;
|
|
531
|
-
type Model = string |
|
|
526
|
+
type Model = string | ScoreModelBase;
|
|
532
527
|
}
|
|
533
528
|
namespace Response {
|
|
534
529
|
namespace Streaming {
|
|
@@ -538,33 +533,34 @@ export declare namespace Query {
|
|
|
538
533
|
created: number;
|
|
539
534
|
model: string;
|
|
540
535
|
object: "chat.completion.chunk";
|
|
541
|
-
service_tier?: Chat.Completions.Response.ServiceTier;
|
|
542
|
-
system_fingerprint?: string;
|
|
543
536
|
usage?: Chat.Completions.Response.Usage;
|
|
544
|
-
|
|
537
|
+
weight_data?: WeightData;
|
|
545
538
|
}
|
|
546
539
|
namespace ChatCompletionChunk {
|
|
547
540
|
function merged(a: ChatCompletionChunk, b: ChatCompletionChunk): [ChatCompletionChunk, boolean];
|
|
548
541
|
}
|
|
549
542
|
interface Choice {
|
|
550
|
-
delta:
|
|
543
|
+
delta: Delta;
|
|
551
544
|
finish_reason: Chat.Completions.Response.FinishReason | null;
|
|
552
545
|
index: number;
|
|
553
546
|
logprobs?: Chat.Completions.Response.Logprobs;
|
|
554
|
-
|
|
555
|
-
confidence_id?: ConfidenceId;
|
|
556
|
-
confidence_weight?: number;
|
|
547
|
+
weight?: number;
|
|
557
548
|
confidence?: number;
|
|
558
|
-
embedding?: EmbeddingsResponse | ObjectiveAIError;
|
|
559
549
|
error?: ObjectiveAIError;
|
|
560
|
-
model
|
|
561
|
-
model_index
|
|
562
|
-
completion_metadata
|
|
550
|
+
model?: string;
|
|
551
|
+
model_index?: number | null;
|
|
552
|
+
completion_metadata?: CompletionMetadata;
|
|
563
553
|
}
|
|
564
554
|
namespace Choice {
|
|
565
555
|
function merged(a: Choice, b: Choice): [Choice, boolean];
|
|
566
556
|
function mergedList(a: Choice[], b: Choice[]): [Choice[], boolean];
|
|
567
557
|
}
|
|
558
|
+
interface Delta extends Chat.Completions.Response.Streaming.Delta {
|
|
559
|
+
vote?: number[];
|
|
560
|
+
}
|
|
561
|
+
namespace Delta {
|
|
562
|
+
function merged(a: Delta, b: Delta): [Delta, boolean];
|
|
563
|
+
}
|
|
568
564
|
}
|
|
569
565
|
namespace Unary {
|
|
570
566
|
interface ChatCompletion {
|
|
@@ -573,30 +569,34 @@ export declare namespace Query {
|
|
|
573
569
|
created: number;
|
|
574
570
|
model: string;
|
|
575
571
|
object: "chat.completion";
|
|
576
|
-
service_tier?: Chat.Completions.Response.ServiceTier;
|
|
577
|
-
system_fingerprint?: string;
|
|
578
572
|
usage?: Chat.Completions.Response.Usage;
|
|
579
|
-
|
|
573
|
+
weight_data?: WeightData | null;
|
|
580
574
|
}
|
|
581
575
|
interface Choice {
|
|
582
|
-
message:
|
|
576
|
+
message: Message;
|
|
583
577
|
finish_reason: Chat.Completions.Response.FinishReason;
|
|
584
578
|
index: number;
|
|
585
579
|
logprobs: Chat.Completions.Response.Logprobs | null;
|
|
586
|
-
|
|
587
|
-
confidence_id: ConfidenceId | null;
|
|
588
|
-
confidence_weight: number | null;
|
|
580
|
+
weight: number | null;
|
|
589
581
|
confidence: number | null;
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
model: string;
|
|
582
|
+
error: ObjectiveAIError | null;
|
|
583
|
+
model: string | null;
|
|
593
584
|
model_index: number | null;
|
|
594
|
-
completion_metadata: CompletionMetadata;
|
|
585
|
+
completion_metadata: CompletionMetadata | null;
|
|
586
|
+
}
|
|
587
|
+
interface Message extends Chat.Completions.Response.Unary.Message {
|
|
588
|
+
vote: number[] | null;
|
|
595
589
|
}
|
|
596
590
|
}
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
591
|
+
type WeightData = WeightData.Static | WeightData.TrainingTable;
|
|
592
|
+
namespace WeightData {
|
|
593
|
+
interface Static {
|
|
594
|
+
type: "static";
|
|
595
|
+
}
|
|
596
|
+
interface TrainingTable {
|
|
597
|
+
type: "training_table";
|
|
598
|
+
embeddings_response: EmbeddingsResponse;
|
|
599
|
+
}
|
|
600
600
|
}
|
|
601
601
|
interface EmbeddingsResponse {
|
|
602
602
|
data: EmbeddingsResponse.Embedding[];
|
|
@@ -623,358 +623,6 @@ export declare namespace Query {
|
|
|
623
623
|
namespace CompletionMetadata {
|
|
624
624
|
function merged(a: CompletionMetadata, b: CompletionMetadata): [CompletionMetadata, boolean];
|
|
625
625
|
}
|
|
626
|
-
type ConfidenceId = string | Record<string, number>;
|
|
627
|
-
}
|
|
628
|
-
function list(openai: OpenAI, listOptions?: Chat.Completions.ListOptions, options?: OpenAI.RequestOptions): Promise<{
|
|
629
|
-
data: Chat.Completions.ListItem[];
|
|
630
|
-
}>;
|
|
631
|
-
function publish(openai: OpenAI, id: string, options?: OpenAI.RequestOptions): Promise<void>;
|
|
632
|
-
function retrieve(openai: OpenAI, id: string, options?: OpenAI.RequestOptions): Promise<{
|
|
633
|
-
request: Request.ChatCompletionCreateParams;
|
|
634
|
-
response: Response.Unary.ChatCompletion;
|
|
635
|
-
correct_confidence_id?: string;
|
|
636
|
-
}>;
|
|
637
|
-
function trainingTableMark(openai: OpenAI, id: string, correctConfidenceId: string, options?: OpenAI.RequestOptions): Promise<void>;
|
|
638
|
-
function trainingTableUnmark(openai: OpenAI, id: string, options?: OpenAI.RequestOptions): Promise<void>;
|
|
639
|
-
function create(openai: OpenAI, body: Request.ChatCompletionCreateParamsStreaming, options?: OpenAI.RequestOptions): Promise<Stream<Response.Streaming.ChatCompletionChunk | ObjectiveAIError>>;
|
|
640
|
-
function create(openai: OpenAI, body: Request.ChatCompletionCreateParamsNonStreaming, options?: OpenAI.RequestOptions): Promise<Response.Unary.ChatCompletion>;
|
|
641
|
-
}
|
|
642
|
-
}
|
|
643
|
-
export declare namespace QueryTool {
|
|
644
|
-
namespace Completions {
|
|
645
|
-
namespace Request {
|
|
646
|
-
interface ChatCompletionCreateParamsBase {
|
|
647
|
-
messages: Chat.Completions.Request.Message[];
|
|
648
|
-
model: Query.Completions.Request.Model;
|
|
649
|
-
logprobs?: boolean | null;
|
|
650
|
-
n?: number | null;
|
|
651
|
-
prediction?: Chat.Completions.Request.Prediction | null;
|
|
652
|
-
response_format: ResponseFormat;
|
|
653
|
-
seed?: number | null;
|
|
654
|
-
service_tier?: Chat.Completions.Request.ServiceTier | null;
|
|
655
|
-
stream_options?: Chat.Completions.Request.StreamOptions | null;
|
|
656
|
-
tools?: Chat.Completions.Request.Tool[] | null;
|
|
657
|
-
top_logprobs?: number | null;
|
|
658
|
-
usage?: Chat.Completions.Request.Usage | null;
|
|
659
|
-
embeddings?: string | null;
|
|
660
|
-
select_deterministic?: boolean | null;
|
|
661
|
-
}
|
|
662
|
-
interface ChatCompletionCreateParamsStreaming extends ChatCompletionCreateParamsBase {
|
|
663
|
-
stream: true;
|
|
664
|
-
}
|
|
665
|
-
interface ChatCompletionCreateParamsNonStreaming extends ChatCompletionCreateParamsBase {
|
|
666
|
-
stream?: false | null;
|
|
667
|
-
}
|
|
668
|
-
type ChatCompletionCreateParams = ChatCompletionCreateParamsStreaming | ChatCompletionCreateParamsNonStreaming;
|
|
669
|
-
type ResponseFormat = ResponseFormat.Simple | ResponseFormat.NumberQuery | ResponseFormat.MultipleChoiceQuery | ResponseFormat.MultipleChoiceOptionsQuery | ResponseFormat.WeightedAverageChoiceQuery;
|
|
670
|
-
namespace ResponseFormat {
|
|
671
|
-
type Simple = {
|
|
672
|
-
tool: "simple_query";
|
|
673
|
-
top?: number | null;
|
|
674
|
-
select_deterministic?: boolean | null;
|
|
675
|
-
} | ({
|
|
676
|
-
tool: "simple_query";
|
|
677
|
-
top?: number | null;
|
|
678
|
-
select_deterministic?: boolean | null;
|
|
679
|
-
} & Chat.Completions.Request.ResponseFormat);
|
|
680
|
-
interface NumberQuery {
|
|
681
|
-
tool: "number_query";
|
|
682
|
-
}
|
|
683
|
-
interface MultipleChoiceQuery {
|
|
684
|
-
tool: "multiple_choice_query";
|
|
685
|
-
choices: string[];
|
|
686
|
-
}
|
|
687
|
-
interface MultipleChoiceOptionsQuery {
|
|
688
|
-
tool: "multiple_choice_options_query";
|
|
689
|
-
min_items: number;
|
|
690
|
-
max_items: number;
|
|
691
|
-
}
|
|
692
|
-
type WeightedAverageChoiceQuery = {
|
|
693
|
-
tool: "weighted_average_choice_query";
|
|
694
|
-
embeddings_model: string;
|
|
695
|
-
select_deterministic?: boolean | null;
|
|
696
|
-
} | ({
|
|
697
|
-
tool: "weighted_average_choice_query";
|
|
698
|
-
embeddings_model: string;
|
|
699
|
-
select_deterministic?: boolean | null;
|
|
700
|
-
} & Chat.Completions.Request.ResponseFormat);
|
|
701
|
-
}
|
|
702
|
-
}
|
|
703
|
-
namespace Response {
|
|
704
|
-
namespace Streaming {
|
|
705
|
-
interface ChatCompletionChunk {
|
|
706
|
-
id: string;
|
|
707
|
-
choices: Choice[];
|
|
708
|
-
created: number;
|
|
709
|
-
model: Model;
|
|
710
|
-
object: "chat.completion.chunk";
|
|
711
|
-
service_tier?: Chat.Completions.Response.ServiceTier;
|
|
712
|
-
system_fingerprint?: string;
|
|
713
|
-
usage?: Chat.Completions.Response.Usage;
|
|
714
|
-
}
|
|
715
|
-
namespace ChatCompletionChunk {
|
|
716
|
-
function merged(a: ChatCompletionChunk, b: ChatCompletionChunk): [ChatCompletionChunk, boolean];
|
|
717
|
-
}
|
|
718
|
-
interface Choice {
|
|
719
|
-
delta: Delta;
|
|
720
|
-
finish_reason: Chat.Completions.Response.FinishReason | null;
|
|
721
|
-
index: number;
|
|
722
|
-
logprobs?: Chat.Completions.Response.Logprobs;
|
|
723
|
-
}
|
|
724
|
-
namespace Choice {
|
|
725
|
-
function merged(a: Choice, b: Choice): [Choice, boolean];
|
|
726
|
-
function mergedList(a: Choice[], b: Choice[]): [Choice[], boolean];
|
|
727
|
-
}
|
|
728
|
-
interface Delta {
|
|
729
|
-
content?: string;
|
|
730
|
-
refusal?: string;
|
|
731
|
-
role?: Chat.Completions.Response.Role;
|
|
732
|
-
tool_calls?: Chat.Completions.Response.Streaming.ToolCall[];
|
|
733
|
-
reasoning?: Reasoning;
|
|
734
|
-
}
|
|
735
|
-
namespace Delta {
|
|
736
|
-
function merged(a: Delta, b: Delta): [Delta, boolean];
|
|
737
|
-
}
|
|
738
|
-
type Reasoning = ReasoningCompletion | ReasoningCompletion[];
|
|
739
|
-
namespace Reasoning {
|
|
740
|
-
function merged(a: Reasoning, b: Reasoning): [Reasoning, boolean];
|
|
741
|
-
}
|
|
742
|
-
type ReasoningCompletion = ReasoningCompletion.QueryCompletion | ReasoningCompletion.ChatCompletion;
|
|
743
|
-
namespace ReasoningCompletion {
|
|
744
|
-
type QueryCompletion = {
|
|
745
|
-
index: number;
|
|
746
|
-
type: "query";
|
|
747
|
-
error?: ObjectiveAIError;
|
|
748
|
-
} & Query.Completions.Response.Streaming.ChatCompletionChunk;
|
|
749
|
-
namespace QueryCompletion {
|
|
750
|
-
function merged(a: QueryCompletion, b: QueryCompletion): [QueryCompletion, boolean];
|
|
751
|
-
}
|
|
752
|
-
type ChatCompletion = {
|
|
753
|
-
index: number;
|
|
754
|
-
type: "chat";
|
|
755
|
-
error?: ObjectiveAIError;
|
|
756
|
-
} & Chat.Completions.Response.Streaming.ChatCompletionChunk;
|
|
757
|
-
namespace ChatCompletion {
|
|
758
|
-
function merged(a: ChatCompletion, b: ChatCompletion): [ChatCompletion, boolean];
|
|
759
|
-
}
|
|
760
|
-
}
|
|
761
|
-
}
|
|
762
|
-
namespace Unary {
|
|
763
|
-
interface ChatCompletion {
|
|
764
|
-
id: string;
|
|
765
|
-
choices: Choice[];
|
|
766
|
-
created: number;
|
|
767
|
-
model: Model;
|
|
768
|
-
object: "chat.completion";
|
|
769
|
-
service_tier?: Chat.Completions.Response.ServiceTier;
|
|
770
|
-
system_fingerprint?: string;
|
|
771
|
-
usage?: Chat.Completions.Response.Usage;
|
|
772
|
-
}
|
|
773
|
-
interface Choice {
|
|
774
|
-
message: Message;
|
|
775
|
-
finish_reason: Chat.Completions.Response.FinishReason;
|
|
776
|
-
index: number;
|
|
777
|
-
logprobs: Chat.Completions.Response.Logprobs | null;
|
|
778
|
-
}
|
|
779
|
-
interface Message {
|
|
780
|
-
content: string | null;
|
|
781
|
-
refusal: string | null;
|
|
782
|
-
role: Chat.Completions.Response.Role;
|
|
783
|
-
annotations?: Chat.Completions.Response.Unary.Annotation[];
|
|
784
|
-
audio?: Chat.Completions.Response.Unary.Audio;
|
|
785
|
-
tool_calls?: Chat.Completions.Response.Unary.ToolCall[];
|
|
786
|
-
reasoning?: Reasoning;
|
|
787
|
-
}
|
|
788
|
-
type Reasoning = ReasoningCompletion | ReasoningCompletion[];
|
|
789
|
-
type ReasoningCompletion = ReasoningCompletion.QueryCompletion | ReasoningCompletion.ChatCompletion;
|
|
790
|
-
namespace ReasoningCompletion {
|
|
791
|
-
type QueryCompletion = {
|
|
792
|
-
index: number;
|
|
793
|
-
type: "query";
|
|
794
|
-
error?: ObjectiveAIError;
|
|
795
|
-
} & Query.Completions.Response.Unary.ChatCompletion;
|
|
796
|
-
type ChatCompletion = {
|
|
797
|
-
index: number;
|
|
798
|
-
type: "chat";
|
|
799
|
-
error?: ObjectiveAIError;
|
|
800
|
-
} & Chat.Completions.Response.Unary.ChatCompletion;
|
|
801
|
-
}
|
|
802
|
-
}
|
|
803
|
-
type Model = "simple_query" | "number_query" | "multiple_choice_query" | "multiple_choice_options_query" | "weighted_average_choice_query";
|
|
804
|
-
}
|
|
805
|
-
function list(openai: OpenAI, listOptions?: Chat.Completions.ListOptions, options?: OpenAI.RequestOptions): Promise<{
|
|
806
|
-
data: Chat.Completions.ListItem[];
|
|
807
|
-
}>;
|
|
808
|
-
function publish(openai: OpenAI, id: string, options?: OpenAI.RequestOptions): Promise<void>;
|
|
809
|
-
function retrieve(openai: OpenAI, id: string, options?: OpenAI.RequestOptions): Promise<{
|
|
810
|
-
request: Request.ChatCompletionCreateParams;
|
|
811
|
-
response: Response.Unary.ChatCompletion;
|
|
812
|
-
}>;
|
|
813
|
-
function create(openai: OpenAI, body: Request.ChatCompletionCreateParamsStreaming, options?: OpenAI.RequestOptions): Promise<Stream<Response.Streaming.ChatCompletionChunk | ObjectiveAIError>>;
|
|
814
|
-
function create(openai: OpenAI, body: Request.ChatCompletionCreateParamsNonStreaming, options?: OpenAI.RequestOptions): Promise<Response.Unary.ChatCompletion>;
|
|
815
|
-
}
|
|
816
|
-
}
|
|
817
|
-
export declare namespace QueryChat {
|
|
818
|
-
namespace Completions {
|
|
819
|
-
namespace Request {
|
|
820
|
-
interface ChatCompletionCreateParamsBase {
|
|
821
|
-
messages: Chat.Completions.Request.Message[];
|
|
822
|
-
model: string;
|
|
823
|
-
frequency_penalty?: number | null;
|
|
824
|
-
logit_bias?: Record<string, number> | null;
|
|
825
|
-
logprobs?: boolean | null;
|
|
826
|
-
max_completion_tokens?: number | null;
|
|
827
|
-
modalities?: string[] | null;
|
|
828
|
-
parallel_tool_calls?: boolean | null;
|
|
829
|
-
prediction?: Chat.Completions.Request.Prediction | null;
|
|
830
|
-
presence_penalty?: number | null;
|
|
831
|
-
reasoning_effort?: Chat.Completions.Request.ReasoningEffort | null;
|
|
832
|
-
response_format?: Chat.Completions.Request.ResponseFormat | null;
|
|
833
|
-
seed?: number | null;
|
|
834
|
-
service_tier?: Chat.Completions.Request.ServiceTier | null;
|
|
835
|
-
stop?: Chat.Completions.Request.Stop | null;
|
|
836
|
-
stream_options?: Chat.Completions.Request.StreamOptions | null;
|
|
837
|
-
temperature?: number | null;
|
|
838
|
-
top_logprobs?: number | null;
|
|
839
|
-
top_p?: number | null;
|
|
840
|
-
max_tokens?: number | null;
|
|
841
|
-
min_p?: number | null;
|
|
842
|
-
provider?: Chat.Completions.Request.ProviderPreferences | null;
|
|
843
|
-
reasoning?: Chat.Completions.Request.Reasoning | null;
|
|
844
|
-
repetition_penalty?: number | null;
|
|
845
|
-
top_a?: number | null;
|
|
846
|
-
top_k?: number | null;
|
|
847
|
-
usage?: Chat.Completions.Request.Usage | null;
|
|
848
|
-
verbosity?: Chat.Completions.Request.Verbosity | null;
|
|
849
|
-
models?: string[] | null;
|
|
850
|
-
training_table_name?: string | null;
|
|
851
|
-
simple_query: QueryToolParams;
|
|
852
|
-
multiple_choice_query: QueryToolParams;
|
|
853
|
-
multiple_choice_options_query: QueryToolParams;
|
|
854
|
-
}
|
|
855
|
-
interface ChatCompletionCreateParamsStreaming extends ChatCompletionCreateParamsBase {
|
|
856
|
-
stream: true;
|
|
857
|
-
}
|
|
858
|
-
interface ChatCompletionCreateParamsNonStreaming extends ChatCompletionCreateParamsBase {
|
|
859
|
-
stream?: false | null;
|
|
860
|
-
}
|
|
861
|
-
type ChatCompletionCreateParams = ChatCompletionCreateParamsStreaming | ChatCompletionCreateParamsNonStreaming;
|
|
862
|
-
interface QueryToolParams {
|
|
863
|
-
model: Query.Completions.Request.Model;
|
|
864
|
-
logprobs?: boolean | null;
|
|
865
|
-
n?: number | null;
|
|
866
|
-
prediction?: Chat.Completions.Request.Prediction | null;
|
|
867
|
-
seed?: number | null;
|
|
868
|
-
service_tier?: Chat.Completions.Request.ServiceTier | null;
|
|
869
|
-
tools?: Chat.Completions.Request.Tool[] | null;
|
|
870
|
-
top_logprobs?: number | null;
|
|
871
|
-
embeddings?: string | null;
|
|
872
|
-
}
|
|
873
|
-
}
|
|
874
|
-
namespace Response {
|
|
875
|
-
namespace Streaming {
|
|
876
|
-
interface ChatCompletionChunk {
|
|
877
|
-
id: string;
|
|
878
|
-
choices: Choice[];
|
|
879
|
-
created: number;
|
|
880
|
-
model: string;
|
|
881
|
-
object: "chat.completion.chunk";
|
|
882
|
-
service_tier?: Chat.Completions.Response.ServiceTier;
|
|
883
|
-
system_fingerprint?: string;
|
|
884
|
-
usage?: Chat.Completions.Response.Usage;
|
|
885
|
-
}
|
|
886
|
-
namespace ChatCompletionChunk {
|
|
887
|
-
function merged(a: ChatCompletionChunk, b: ChatCompletionChunk): [ChatCompletionChunk, boolean];
|
|
888
|
-
}
|
|
889
|
-
interface Choice {
|
|
890
|
-
delta: Delta;
|
|
891
|
-
finish_reason: Chat.Completions.Response.FinishReason | null;
|
|
892
|
-
index: number;
|
|
893
|
-
logprobs?: Chat.Completions.Response.Logprobs;
|
|
894
|
-
}
|
|
895
|
-
namespace Choice {
|
|
896
|
-
function merged(a: Choice, b: Choice): [Choice, boolean];
|
|
897
|
-
function mergedList(a: Choice[], b: Choice[]): [Choice[], boolean];
|
|
898
|
-
}
|
|
899
|
-
interface Delta {
|
|
900
|
-
content?: string;
|
|
901
|
-
refusal?: string;
|
|
902
|
-
role?: Chat.Completions.Response.Role;
|
|
903
|
-
tool_calls?: Chat.Completions.Response.Streaming.ToolCall[];
|
|
904
|
-
images?: Chat.Completions.Response.Image[];
|
|
905
|
-
reasoning?: Reasoning;
|
|
906
|
-
}
|
|
907
|
-
namespace Delta {
|
|
908
|
-
function merged(a: Delta, b: Delta): [Delta, boolean];
|
|
909
|
-
}
|
|
910
|
-
type Reasoning = ReasoningCompletion | ReasoningCompletion[];
|
|
911
|
-
namespace Reasoning {
|
|
912
|
-
function merged(a: Reasoning, b: Reasoning): [Reasoning, boolean];
|
|
913
|
-
}
|
|
914
|
-
type ReasoningCompletion = ReasoningCompletion.QueryToolCompletion | ReasoningCompletion.ChatCompletion;
|
|
915
|
-
namespace ReasoningCompletion {
|
|
916
|
-
type QueryToolCompletion = {
|
|
917
|
-
index: number;
|
|
918
|
-
type: "query_tool";
|
|
919
|
-
tool_call_id: string;
|
|
920
|
-
error?: ObjectiveAIError;
|
|
921
|
-
} & QueryTool.Completions.Response.Streaming.ChatCompletionChunk;
|
|
922
|
-
namespace QueryToolCompletion {
|
|
923
|
-
function merged(a: QueryToolCompletion, b: QueryToolCompletion): [QueryToolCompletion, boolean];
|
|
924
|
-
}
|
|
925
|
-
type ChatCompletion = {
|
|
926
|
-
index: number;
|
|
927
|
-
type: "chat";
|
|
928
|
-
error?: ObjectiveAIError;
|
|
929
|
-
} & Chat.Completions.Response.Streaming.ChatCompletionChunk;
|
|
930
|
-
namespace ChatCompletion {
|
|
931
|
-
function merged(a: ChatCompletion, b: ChatCompletion): [ChatCompletion, boolean];
|
|
932
|
-
}
|
|
933
|
-
}
|
|
934
|
-
}
|
|
935
|
-
namespace Unary {
|
|
936
|
-
interface ChatCompletion {
|
|
937
|
-
id: string;
|
|
938
|
-
choices: Choice[];
|
|
939
|
-
created: number;
|
|
940
|
-
model: string;
|
|
941
|
-
object: "chat.completion";
|
|
942
|
-
service_tier?: Chat.Completions.Response.ServiceTier;
|
|
943
|
-
system_fingerprint?: string;
|
|
944
|
-
usage?: Chat.Completions.Response.Usage;
|
|
945
|
-
}
|
|
946
|
-
interface Choice {
|
|
947
|
-
message: Message;
|
|
948
|
-
finish_reason: Chat.Completions.Response.FinishReason;
|
|
949
|
-
index: number;
|
|
950
|
-
logprobs: Chat.Completions.Response.Logprobs | null;
|
|
951
|
-
}
|
|
952
|
-
interface Message {
|
|
953
|
-
content: string | null;
|
|
954
|
-
refusal: string | null;
|
|
955
|
-
role: Chat.Completions.Response.Role;
|
|
956
|
-
annotations?: Chat.Completions.Response.Unary.Annotation[];
|
|
957
|
-
audio?: Chat.Completions.Response.Unary.Audio;
|
|
958
|
-
tool_calls?: Chat.Completions.Response.Unary.ToolCall[];
|
|
959
|
-
images?: Chat.Completions.Response.Image[];
|
|
960
|
-
reasoning?: Reasoning;
|
|
961
|
-
}
|
|
962
|
-
type Reasoning = ReasoningCompletion | ReasoningCompletion[];
|
|
963
|
-
type ReasoningCompletion = ReasoningCompletion.QueryToolCompletion | ReasoningCompletion.ChatCompletion;
|
|
964
|
-
namespace ReasoningCompletion {
|
|
965
|
-
type QueryToolCompletion = {
|
|
966
|
-
index: number;
|
|
967
|
-
type: "query_tool";
|
|
968
|
-
tool_call_id: string;
|
|
969
|
-
error?: ObjectiveAIError;
|
|
970
|
-
} & QueryTool.Completions.Response.Unary.ChatCompletion;
|
|
971
|
-
type ChatCompletion = {
|
|
972
|
-
index: number;
|
|
973
|
-
type: "chat";
|
|
974
|
-
error?: ObjectiveAIError;
|
|
975
|
-
} & Chat.Completions.Response.Unary.ChatCompletion;
|
|
976
|
-
}
|
|
977
|
-
}
|
|
978
626
|
}
|
|
979
627
|
function list(openai: OpenAI, listOptions?: Chat.Completions.ListOptions, options?: OpenAI.RequestOptions): Promise<{
|
|
980
628
|
data: Chat.Completions.ListItem[];
|
|
@@ -983,7 +631,11 @@ export declare namespace QueryChat {
|
|
|
983
631
|
function retrieve(openai: OpenAI, id: string, options?: OpenAI.RequestOptions): Promise<{
|
|
984
632
|
request: Request.ChatCompletionCreateParams;
|
|
985
633
|
response: Response.Unary.ChatCompletion;
|
|
634
|
+
correct_vote: number[] | null;
|
|
635
|
+
correct_vote_modified: string | null;
|
|
986
636
|
}>;
|
|
637
|
+
function trainingTableAdd(openai: OpenAI, id: string, correctVote: number[], options?: OpenAI.RequestOptions): Promise<void>;
|
|
638
|
+
function trainingTableDelete(openai: OpenAI, id: string, options?: OpenAI.RequestOptions): Promise<void>;
|
|
987
639
|
function create(openai: OpenAI, body: Request.ChatCompletionCreateParamsStreaming, options?: OpenAI.RequestOptions): Promise<Stream<Response.Streaming.ChatCompletionChunk | ObjectiveAIError>>;
|
|
988
640
|
function create(openai: OpenAI, body: Request.ChatCompletionCreateParamsNonStreaming, options?: OpenAI.RequestOptions): Promise<Response.Unary.ChatCompletion>;
|
|
989
641
|
}
|
|
@@ -1108,116 +760,116 @@ export declare namespace Auth {
|
|
|
1108
760
|
}
|
|
1109
761
|
}
|
|
1110
762
|
export interface Metadata {
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
763
|
+
score_requests: number;
|
|
764
|
+
score_completion_tokens: number;
|
|
765
|
+
score_prompt_tokens: number;
|
|
766
|
+
score_total_cost: number;
|
|
1115
767
|
chat_requests: number;
|
|
1116
768
|
chat_completion_tokens: number;
|
|
1117
769
|
chat_prompt_tokens: number;
|
|
1118
|
-
|
|
1119
|
-
embedding_completion_tokens: number;
|
|
1120
|
-
embedding_prompt_tokens: number;
|
|
1121
|
-
embedding_cost: number;
|
|
770
|
+
chat_total_cost: number;
|
|
1122
771
|
}
|
|
1123
772
|
export declare namespace Metadata {
|
|
1124
773
|
function get(openai: OpenAI, options?: OpenAI.RequestOptions): Promise<Metadata>;
|
|
1125
774
|
}
|
|
1126
|
-
export interface
|
|
1127
|
-
|
|
1128
|
-
weight:
|
|
775
|
+
export interface ScoreLlmBase {
|
|
776
|
+
model: string;
|
|
777
|
+
weight: ScoreLlm.Weight;
|
|
778
|
+
output_mode: ScoreLlm.OutputMode;
|
|
779
|
+
synthetic_reasoning?: boolean | null;
|
|
780
|
+
top_logprobs?: number | null;
|
|
781
|
+
prefix_messages?: Chat.Completions.Request.Message[] | null;
|
|
782
|
+
suffix_messages?: Chat.Completions.Request.Message[] | null;
|
|
783
|
+
frequency_penalty?: number | null;
|
|
784
|
+
logit_bias?: Record<string, number> | null;
|
|
785
|
+
max_completion_tokens?: number | null;
|
|
786
|
+
presence_penalty?: number | null;
|
|
787
|
+
stop?: Chat.Completions.Request.Stop | null;
|
|
788
|
+
temperature?: number | null;
|
|
789
|
+
top_p?: number | null;
|
|
790
|
+
max_tokens?: number | null;
|
|
791
|
+
min_p?: number | null;
|
|
792
|
+
provider?: Chat.Completions.Request.ProviderPreferences | null;
|
|
793
|
+
reasoning?: Chat.Completions.Request.Reasoning | null;
|
|
794
|
+
repetition_penalty?: number | null;
|
|
795
|
+
top_a?: number | null;
|
|
796
|
+
top_k?: number | null;
|
|
797
|
+
verbosity?: Chat.Completions.Request.Verbosity | null;
|
|
798
|
+
models?: string[] | null;
|
|
1129
799
|
}
|
|
1130
|
-
export interface
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
models: QueryModel.QueryLlm[];
|
|
1134
|
-
weight: QueryModel.Weight;
|
|
800
|
+
export interface ScoreLlmWithoutIndices extends ScoreLlmBase {
|
|
801
|
+
id: string;
|
|
802
|
+
training_table_id?: string;
|
|
1135
803
|
}
|
|
1136
|
-
export interface
|
|
1137
|
-
user_id: string;
|
|
804
|
+
export interface ScoreLlmWithoutIndicesWithMetadata extends ScoreLlmWithoutIndices {
|
|
1138
805
|
created: string;
|
|
1139
806
|
requests: number;
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
807
|
+
completion_tokens: number;
|
|
808
|
+
prompt_tokens: number;
|
|
809
|
+
total_cost: number;
|
|
810
|
+
}
|
|
811
|
+
export interface ScoreLlm extends ScoreLlmWithoutIndices {
|
|
812
|
+
index: number;
|
|
813
|
+
training_table_index?: number;
|
|
1146
814
|
}
|
|
1147
|
-
export declare namespace
|
|
815
|
+
export declare namespace ScoreLlm {
|
|
1148
816
|
type Weight = Weight.Static | Weight.TrainingTable;
|
|
1149
817
|
namespace Weight {
|
|
1150
818
|
interface Static {
|
|
1151
819
|
type: "static";
|
|
820
|
+
weight: number;
|
|
1152
821
|
}
|
|
1153
822
|
interface TrainingTable {
|
|
1154
823
|
type: "training_table";
|
|
1155
|
-
|
|
1156
|
-
|
|
824
|
+
base_weight: number;
|
|
825
|
+
min_weight: number;
|
|
826
|
+
max_weight: number;
|
|
1157
827
|
}
|
|
1158
828
|
}
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
namespace QueryLlm {
|
|
1203
|
-
type Mode = "generate" | "select_thinking" | "select_non_thinking" | "select_thinking_logprobs" | "select_non_thinking_logprobs";
|
|
1204
|
-
type Weight = Weight.Static | Weight.TrainingTable;
|
|
1205
|
-
namespace Weight {
|
|
1206
|
-
interface Static {
|
|
1207
|
-
type: "static";
|
|
1208
|
-
weight: number;
|
|
1209
|
-
}
|
|
1210
|
-
interface TrainingTable {
|
|
1211
|
-
type: "training_table";
|
|
1212
|
-
base_weight: number;
|
|
1213
|
-
min_weight: number;
|
|
1214
|
-
max_weight: number;
|
|
1215
|
-
}
|
|
829
|
+
type OutputMode = "instruction" | "json_schema" | "tool_call";
|
|
830
|
+
function list(openai: OpenAI, listOptions?: Models.ListOptions, options?: OpenAI.RequestOptions): Promise<{
|
|
831
|
+
data: string[];
|
|
832
|
+
}>;
|
|
833
|
+
function count(openai: OpenAI, options?: OpenAI.RequestOptions): Promise<{
|
|
834
|
+
data: number;
|
|
835
|
+
}>;
|
|
836
|
+
function retrieve(openai: OpenAI, model: string, retrieveOptions?: Models.RetrieveOptionsWithoutMetadata, options?: OpenAI.RequestOptions): Promise<ScoreLlmWithoutIndices>;
|
|
837
|
+
function retrieve(openai: OpenAI, model: string, retrieveOptions: Models.RetrieveOptionsWithMetadata, options?: OpenAI.RequestOptions): Promise<ScoreLlmWithoutIndicesWithMetadata>;
|
|
838
|
+
function retrieveValidate(openai: OpenAI, model: ScoreLlmBase, retrieveOptions?: Models.RetrieveOptionsWithoutMetadata, options?: OpenAI.RequestOptions): Promise<ScoreLlmWithoutIndices>;
|
|
839
|
+
function retrieveValidate(openai: OpenAI, model: ScoreLlmBase, retrieveOptions: Models.RetrieveOptionsWithMetadata, options?: OpenAI.RequestOptions): Promise<ScoreLlmWithoutIndicesWithMetadata>;
|
|
840
|
+
}
|
|
841
|
+
export interface ScoreModelBase {
|
|
842
|
+
llms: ScoreLlmBase[];
|
|
843
|
+
weight: ScoreModel.Weight;
|
|
844
|
+
}
|
|
845
|
+
export interface ScoreModel {
|
|
846
|
+
id: string;
|
|
847
|
+
training_table_id?: string;
|
|
848
|
+
llms: ScoreLlm[];
|
|
849
|
+
weight: ScoreModel.Weight;
|
|
850
|
+
}
|
|
851
|
+
export interface ScoreModelWithMetadata extends ScoreModel {
|
|
852
|
+
created: string;
|
|
853
|
+
requests: number;
|
|
854
|
+
completion_tokens: number;
|
|
855
|
+
prompt_tokens: number;
|
|
856
|
+
total_cost: number;
|
|
857
|
+
}
|
|
858
|
+
export declare namespace ScoreModel {
|
|
859
|
+
type Weight = Weight.Static | Weight.TrainingTable;
|
|
860
|
+
namespace Weight {
|
|
861
|
+
interface Static {
|
|
862
|
+
type: "static";
|
|
863
|
+
}
|
|
864
|
+
interface TrainingTable {
|
|
865
|
+
type: "training_table";
|
|
866
|
+
embeddings: {
|
|
867
|
+
model: string;
|
|
868
|
+
max_tokens: number;
|
|
869
|
+
provider?: Chat.Completions.Request.ProviderPreferences | null;
|
|
870
|
+
};
|
|
871
|
+
top: number;
|
|
1216
872
|
}
|
|
1217
|
-
function retrieve(openai: OpenAI, model: string, retrieveOptions?: Models.RetrieveOptionsWithoutMetadata, options?: OpenAI.RequestOptions): Promise<QueryLlmWithoutIndices>;
|
|
1218
|
-
function retrieve(openai: OpenAI, model: string, retrieveOptions: Models.RetrieveOptionsWithMetadata, options?: OpenAI.RequestOptions): Promise<QueryLlmWithoutIndicesWithMetadata>;
|
|
1219
|
-
function retrieveValidate(openai: OpenAI, model: QueryLlmBase, retrieveOptions?: Models.RetrieveOptionsWithoutMetadata, options?: OpenAI.RequestOptions): Promise<QueryLlmWithoutIndices>;
|
|
1220
|
-
function retrieveValidate(openai: OpenAI, model: QueryLlmBase, retrieveOptions: Models.RetrieveOptionsWithMetadata, options?: OpenAI.RequestOptions): Promise<QueryLlmWithoutIndicesWithMetadata>;
|
|
1221
873
|
}
|
|
1222
874
|
function list(openai: OpenAI, listOptions?: Models.ListOptions, options?: OpenAI.RequestOptions): Promise<{
|
|
1223
875
|
data: string[];
|
|
@@ -1225,10 +877,10 @@ export declare namespace QueryModel {
|
|
|
1225
877
|
function count(openai: OpenAI, options?: OpenAI.RequestOptions): Promise<{
|
|
1226
878
|
count: number;
|
|
1227
879
|
}>;
|
|
1228
|
-
function retrieve(openai: OpenAI, model: string, retrieveOptions?: Models.RetrieveOptionsWithoutMetadata, options?: OpenAI.RequestOptions): Promise<
|
|
1229
|
-
function retrieve(openai: OpenAI, model: string, retrieveOptions: Models.RetrieveOptionsWithMetadata, options?: OpenAI.RequestOptions): Promise<
|
|
1230
|
-
function retrieveValidate(openai: OpenAI, model:
|
|
1231
|
-
function retrieveValidate(openai: OpenAI, model:
|
|
880
|
+
function retrieve(openai: OpenAI, model: string, retrieveOptions?: Models.RetrieveOptionsWithoutMetadata, options?: OpenAI.RequestOptions): Promise<ScoreModel>;
|
|
881
|
+
function retrieve(openai: OpenAI, model: string, retrieveOptions: Models.RetrieveOptionsWithMetadata, options?: OpenAI.RequestOptions): Promise<ScoreModelWithMetadata>;
|
|
882
|
+
function retrieveValidate(openai: OpenAI, model: ScoreModelBase, retrieveOptions?: Models.RetrieveOptionsWithoutMetadata, options?: OpenAI.RequestOptions): Promise<ScoreModel>;
|
|
883
|
+
function retrieveValidate(openai: OpenAI, model: ScoreModelBase, retrieveOptions: Models.RetrieveOptionsWithMetadata, options?: OpenAI.RequestOptions): Promise<ScoreModelWithMetadata>;
|
|
1232
884
|
}
|
|
1233
885
|
export type JsonValue = null | boolean | number | string | JsonValue[] | {
|
|
1234
886
|
[key: string]: JsonValue;
|