objectiveai 1.0.3 → 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,24 +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
|
-
|
|
523
|
-
select_deterministic?: boolean | null;
|
|
517
|
+
choices: string[];
|
|
524
518
|
}
|
|
525
519
|
interface ChatCompletionCreateParamsStreaming extends ChatCompletionCreateParamsBase {
|
|
526
520
|
stream: true;
|
|
@@ -529,7 +523,7 @@ export declare namespace Query {
|
|
|
529
523
|
stream?: false | null;
|
|
530
524
|
}
|
|
531
525
|
type ChatCompletionCreateParams = ChatCompletionCreateParamsStreaming | ChatCompletionCreateParamsNonStreaming;
|
|
532
|
-
type Model = string |
|
|
526
|
+
type Model = string | ScoreModelBase;
|
|
533
527
|
}
|
|
534
528
|
namespace Response {
|
|
535
529
|
namespace Streaming {
|
|
@@ -539,33 +533,34 @@ export declare namespace Query {
|
|
|
539
533
|
created: number;
|
|
540
534
|
model: string;
|
|
541
535
|
object: "chat.completion.chunk";
|
|
542
|
-
service_tier?: Chat.Completions.Response.ServiceTier;
|
|
543
|
-
system_fingerprint?: string;
|
|
544
536
|
usage?: Chat.Completions.Response.Usage;
|
|
545
|
-
|
|
537
|
+
weight_data?: WeightData;
|
|
546
538
|
}
|
|
547
539
|
namespace ChatCompletionChunk {
|
|
548
540
|
function merged(a: ChatCompletionChunk, b: ChatCompletionChunk): [ChatCompletionChunk, boolean];
|
|
549
541
|
}
|
|
550
542
|
interface Choice {
|
|
551
|
-
delta:
|
|
543
|
+
delta: Delta;
|
|
552
544
|
finish_reason: Chat.Completions.Response.FinishReason | null;
|
|
553
545
|
index: number;
|
|
554
546
|
logprobs?: Chat.Completions.Response.Logprobs;
|
|
555
|
-
|
|
556
|
-
confidence_id?: ConfidenceId;
|
|
557
|
-
confidence_weight?: number;
|
|
547
|
+
weight?: number;
|
|
558
548
|
confidence?: number;
|
|
559
|
-
embedding?: EmbeddingsResponse | ObjectiveAIError;
|
|
560
549
|
error?: ObjectiveAIError;
|
|
561
|
-
model
|
|
562
|
-
model_index
|
|
563
|
-
completion_metadata
|
|
550
|
+
model?: string;
|
|
551
|
+
model_index?: number | null;
|
|
552
|
+
completion_metadata?: CompletionMetadata;
|
|
564
553
|
}
|
|
565
554
|
namespace Choice {
|
|
566
555
|
function merged(a: Choice, b: Choice): [Choice, boolean];
|
|
567
556
|
function mergedList(a: Choice[], b: Choice[]): [Choice[], boolean];
|
|
568
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
|
+
}
|
|
569
564
|
}
|
|
570
565
|
namespace Unary {
|
|
571
566
|
interface ChatCompletion {
|
|
@@ -574,30 +569,34 @@ export declare namespace Query {
|
|
|
574
569
|
created: number;
|
|
575
570
|
model: string;
|
|
576
571
|
object: "chat.completion";
|
|
577
|
-
service_tier?: Chat.Completions.Response.ServiceTier;
|
|
578
|
-
system_fingerprint?: string;
|
|
579
572
|
usage?: Chat.Completions.Response.Usage;
|
|
580
|
-
|
|
573
|
+
weight_data?: WeightData | null;
|
|
581
574
|
}
|
|
582
575
|
interface Choice {
|
|
583
|
-
message:
|
|
576
|
+
message: Message;
|
|
584
577
|
finish_reason: Chat.Completions.Response.FinishReason;
|
|
585
578
|
index: number;
|
|
586
579
|
logprobs: Chat.Completions.Response.Logprobs | null;
|
|
587
|
-
|
|
588
|
-
confidence_id: ConfidenceId | null;
|
|
589
|
-
confidence_weight: number | null;
|
|
580
|
+
weight: number | null;
|
|
590
581
|
confidence: number | null;
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
model: string;
|
|
582
|
+
error: ObjectiveAIError | null;
|
|
583
|
+
model: string | null;
|
|
594
584
|
model_index: number | null;
|
|
595
|
-
completion_metadata: CompletionMetadata;
|
|
585
|
+
completion_metadata: CompletionMetadata | null;
|
|
586
|
+
}
|
|
587
|
+
interface Message extends Chat.Completions.Response.Unary.Message {
|
|
588
|
+
vote: number[] | null;
|
|
596
589
|
}
|
|
597
590
|
}
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
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
|
+
}
|
|
601
600
|
}
|
|
602
601
|
interface EmbeddingsResponse {
|
|
603
602
|
data: EmbeddingsResponse.Embedding[];
|
|
@@ -624,357 +623,6 @@ export declare namespace Query {
|
|
|
624
623
|
namespace CompletionMetadata {
|
|
625
624
|
function merged(a: CompletionMetadata, b: CompletionMetadata): [CompletionMetadata, boolean];
|
|
626
625
|
}
|
|
627
|
-
type ConfidenceId = string | Record<string, number>;
|
|
628
|
-
}
|
|
629
|
-
function list(openai: OpenAI, listOptions?: Chat.Completions.ListOptions, options?: OpenAI.RequestOptions): Promise<{
|
|
630
|
-
data: Chat.Completions.ListItem[];
|
|
631
|
-
}>;
|
|
632
|
-
function publish(openai: OpenAI, id: string, options?: OpenAI.RequestOptions): Promise<void>;
|
|
633
|
-
function retrieve(openai: OpenAI, id: string, options?: OpenAI.RequestOptions): Promise<{
|
|
634
|
-
request: Request.ChatCompletionCreateParams;
|
|
635
|
-
response: Response.Unary.ChatCompletion;
|
|
636
|
-
correct_confidence_id?: string;
|
|
637
|
-
}>;
|
|
638
|
-
function trainingTableMark(openai: OpenAI, id: string, correctConfidenceId: string, options?: OpenAI.RequestOptions): Promise<void>;
|
|
639
|
-
function trainingTableUnmark(openai: OpenAI, id: string, options?: OpenAI.RequestOptions): Promise<void>;
|
|
640
|
-
function create(openai: OpenAI, body: Request.ChatCompletionCreateParamsStreaming, options?: OpenAI.RequestOptions): Promise<Stream<Response.Streaming.ChatCompletionChunk | ObjectiveAIError>>;
|
|
641
|
-
function create(openai: OpenAI, body: Request.ChatCompletionCreateParamsNonStreaming, options?: OpenAI.RequestOptions): Promise<Response.Unary.ChatCompletion>;
|
|
642
|
-
}
|
|
643
|
-
}
|
|
644
|
-
export declare namespace QueryTool {
|
|
645
|
-
namespace Completions {
|
|
646
|
-
namespace Request {
|
|
647
|
-
interface ChatCompletionCreateParamsBase {
|
|
648
|
-
messages: Chat.Completions.Request.Message[];
|
|
649
|
-
model: Query.Completions.Request.Model;
|
|
650
|
-
logprobs?: boolean | null;
|
|
651
|
-
n?: number | null;
|
|
652
|
-
prediction?: Chat.Completions.Request.Prediction | null;
|
|
653
|
-
response_format: ResponseFormat;
|
|
654
|
-
seed?: number | null;
|
|
655
|
-
service_tier?: Chat.Completions.Request.ServiceTier | null;
|
|
656
|
-
stream_options?: Chat.Completions.Request.StreamOptions | null;
|
|
657
|
-
tools?: Chat.Completions.Request.Tool[] | null;
|
|
658
|
-
top_logprobs?: number | null;
|
|
659
|
-
usage?: Chat.Completions.Request.Usage | null;
|
|
660
|
-
embeddings?: string | 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;
|