Skip to content

Commit 72a73aa

Browse files
committed
adds batch apis support
1 parent ffd9580 commit 72a73aa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+18497
-1606
lines changed

core/bifrost.go

Lines changed: 759 additions & 0 deletions
Large diffs are not rendered by default.

core/go.mod

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ require (
66
github.com/aws/aws-sdk-go-v2 v1.40.1
77
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.4
88
github.com/aws/aws-sdk-go-v2/config v1.31.13
9+
github.com/aws/aws-sdk-go-v2/credentials v1.18.17
10+
github.com/aws/aws-sdk-go-v2/service/s3 v1.93.0
911
github.com/aws/smithy-go v1.24.0
1012
github.com/bytedance/sonic v1.14.1
1113
github.com/google/uuid v1.6.0
@@ -21,13 +23,15 @@ require (
2123
require (
2224
cloud.google.com/go/compute/metadata v0.9.0 // indirect
2325
github.com/andybalholm/brotli v1.2.0 // indirect
24-
github.com/aws/aws-sdk-go-v2/credentials v1.18.17 // indirect
2526
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.10 // indirect
2627
github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.15 // indirect
2728
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.15 // indirect
2829
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.4 // indirect
30+
github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.15 // indirect
2931
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.4 // indirect
32+
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.9.6 // indirect
3033
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.15 // indirect
34+
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.15 // indirect
3135
github.com/aws/aws-sdk-go-v2/service/sso v1.29.7 // indirect
3236
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.2 // indirect
3337
github.com/aws/aws-sdk-go-v2/service/sts v1.38.7 // indirect

core/go.sum

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,18 @@ github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.15 h1:AvltKnW9ewxX2hFmQS
1818
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.15/go.mod h1:3I4oCdZdmgrREhU74qS1dK9yZ62yumob+58AbFR4cQA=
1919
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.4 h1:WKuaxf++XKWlHWu9ECbMlha8WOEGm0OUEZqm4K/Gcfk=
2020
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.4/go.mod h1:ZWy7j6v1vWGmPReu0iSGvRiise4YI5SkR3OHKTZ6Wuc=
21+
github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.15 h1:NLYTEyZmVZo0Qh183sC8nC+ydJXOOeIL/qI/sS3PdLY=
22+
github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.15/go.mod h1:Z803iB3B0bc8oJV8zH2PERLRfQUJ2n2BXISpsA4+O1M=
2123
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.4 h1:0ryTNEdJbzUCEWkVXEXoqlXV72J5keC1GvILMOuD00E=
2224
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.4/go.mod h1:HQ4qwNZh32C3CBeO6iJLQlgtMzqeG17ziAA/3KDJFow=
25+
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.9.6 h1:P1MU/SuhadGvg2jtviDXPEejU3jBNhoeeAlRadHzvHI=
26+
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.9.6/go.mod h1:5KYaMG6wmVKMFBSfWoyG/zH8pWwzQFnKgpoSRlXHKdQ=
2327
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.15 h1:3/u/4yZOffg5jdNk1sDpOQ4Y+R6Xbh+GzpDrSZjuy3U=
2428
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.15/go.mod h1:4Zkjq0FKjE78NKjabuM4tRXKFzUJWXgP0ItEZK8l7JU=
29+
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.15 h1:wsSQ4SVz5YE1crz0Ap7VBZrV4nNqZt4CIBBT8mnwoNc=
30+
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.15/go.mod h1:I7sditnFGtYMIqPRU1QoHZAUrXkGp4SczmlLwrNPlD0=
31+
github.com/aws/aws-sdk-go-v2/service/s3 v1.93.0 h1:IrbE3B8O9pm3lsg96AXIN5MXX4pECEuExh/A0Du3AuI=
32+
github.com/aws/aws-sdk-go-v2/service/s3 v1.93.0/go.mod h1:/sJLzHtiiZvs6C1RbxS/anSAFwZD6oC6M/kotQzOiLw=
2533
github.com/aws/aws-sdk-go-v2/service/sso v1.29.7 h1:fspVFg6qMx0svs40YgRmE7LZXh9VRZvTT35PfdQR6FM=
2634
github.com/aws/aws-sdk-go-v2/service/sso v1.29.7/go.mod h1:BQTKL3uMECaLaUV3Zc2L4Qybv8C6BIXjuu1dOPyxTQs=
2735
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.2 h1:scVnW+NLXasGOhy7HhkdT9AGb6kjgW7fJ5xYkUaqHs0=

core/internal/testutil/account.go

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,16 @@ type TestScenarios struct {
4141
Embedding bool // Embedding functionality
4242
Reasoning bool // Reasoning/thinking functionality via Responses API
4343
ListModels bool // List available models functionality
44+
BatchCreate bool // Batch API create functionality
45+
BatchList bool // Batch API list functionality
46+
BatchRetrieve bool // Batch API retrieve functionality
47+
BatchCancel bool // Batch API cancel functionality
48+
BatchResults bool // Batch API results functionality
49+
FileUpload bool // File API upload functionality
50+
FileList bool // File API list functionality
51+
FileRetrieve bool // File API retrieve functionality
52+
FileDelete bool // File API delete functionality
53+
FileContent bool // File API content download functionality
4454
}
4555

4656
// ComprehensiveTestConfig extends TestConfig with additional scenarios
@@ -536,6 +546,16 @@ var AllProviderConfigs = []ComprehensiveTestConfig{
536546
Embedding: true,
537547
Reasoning: true, // OpenAI supports reasoning via o1 models
538548
ListModels: true,
549+
BatchCreate: true, // OpenAI supports batch API
550+
BatchList: true, // OpenAI supports batch API
551+
BatchRetrieve: true, // OpenAI supports batch API
552+
BatchCancel: true, // OpenAI supports batch API
553+
BatchResults: true, // OpenAI supports batch API
554+
FileUpload: true, // OpenAI supports file API
555+
FileList: true, // OpenAI supports file API
556+
FileRetrieve: true, // OpenAI supports file API
557+
FileDelete: true, // OpenAI supports file API
558+
FileContent: true, // OpenAI supports file API
539559
},
540560
Fallbacks: []schemas.Fallback{
541561
{Provider: schemas.Anthropic, Model: "claude-3-7-sonnet-20250219"},
@@ -564,6 +584,11 @@ var AllProviderConfigs = []ComprehensiveTestConfig{
564584
TranscriptionStream: false, // Not supported
565585
Embedding: false,
566586
ListModels: true,
587+
BatchCreate: true, // Anthropic supports batch API
588+
BatchList: true, // Anthropic supports batch API
589+
BatchRetrieve: true, // Anthropic supports batch API
590+
BatchCancel: true, // Anthropic supports batch API
591+
BatchResults: true, // Anthropic supports batch API
567592
},
568593
Fallbacks: []schemas.Fallback{
569594
{Provider: schemas.OpenAI, Model: "gpt-4o-mini"},
@@ -592,6 +617,16 @@ var AllProviderConfigs = []ComprehensiveTestConfig{
592617
TranscriptionStream: false, // Not supported
593618
Embedding: true,
594619
ListModels: true,
620+
BatchCreate: true, // Bedrock supports batch via Model Invocation Jobs (requires S3 config)
621+
BatchList: true, // Bedrock supports listing batch jobs
622+
BatchRetrieve: true, // Bedrock supports retrieving batch jobs
623+
BatchCancel: true, // Bedrock supports stopping batch jobs
624+
BatchResults: true, // Bedrock batch results via S3
625+
FileUpload: true, // Bedrock file upload to S3 (requires S3 config)
626+
FileList: true, // Bedrock file list from S3 (requires S3 config)
627+
FileRetrieve: true, // Bedrock file retrieve from S3 (requires S3 config)
628+
FileDelete: true, // Bedrock file delete from S3 (requires S3 config)
629+
FileContent: true, // Bedrock file content from S3 (requires S3 config)
595630
},
596631
Fallbacks: []schemas.Fallback{
597632
{Provider: schemas.OpenAI, Model: "gpt-4o-mini"},
@@ -648,6 +683,16 @@ var AllProviderConfigs = []ComprehensiveTestConfig{
648683
TranscriptionStream: false, // Not supported yet
649684
Embedding: true,
650685
ListModels: true,
686+
BatchCreate: true, // Azure supports batch API
687+
BatchList: true, // Azure supports batch API
688+
BatchRetrieve: true, // Azure supports batch API
689+
BatchCancel: true, // Azure supports batch API
690+
BatchResults: true, // Azure supports batch API
691+
FileUpload: true, // Azure supports file API
692+
FileList: true, // Azure supports file API
693+
FileRetrieve: true, // Azure supports file API
694+
FileDelete: true, // Azure supports file API
695+
FileContent: true, // Azure supports file API
651696
},
652697
Fallbacks: []schemas.Fallback{
653698
{Provider: schemas.OpenAI, Model: "gpt-4o-mini"},
@@ -818,6 +863,16 @@ var AllProviderConfigs = []ComprehensiveTestConfig{
818863
TranscriptionStream: true,
819864
Embedding: true,
820865
ListModels: true,
866+
BatchCreate: true,
867+
BatchList: true,
868+
BatchRetrieve: true,
869+
BatchCancel: true,
870+
BatchResults: true,
871+
FileUpload: true,
872+
FileList: true,
873+
FileRetrieve: true,
874+
FileDelete: true,
875+
FileContent: false, // Gemini doesn't support direct content download
821876
},
822877
Fallbacks: []schemas.Fallback{
823878
{Provider: schemas.OpenAI, Model: "gpt-4o-mini"},

0 commit comments

Comments
 (0)