feat: add native SAP AI Core support #50

Closed
rodin wants to merge 12 commits from feat/aicore-provider into main
2 changed files with 3 additions and 3 deletions
Showing only changes of commit f71f26fcff - Show all commits
+1 -1
View File
49
@@ -253,7 +253,7 @@ func (c *AICoreClient) CompleteAnthropic(ctx context.Context, model string, mess
}
reqBody := anthropicRequest{
AnthropicVersion: "2023-06-01",
// AnthropicVersion omitted - SAP AI Core does not accept it in body
// Model omitted - AI Core deployment already specifies model
MaxTokens: maxTokens,
System: system,
24
+2 -2
View File
4
@@ -206,8 +206,8 @@ func TestAICoreClient_CompleteAnthropic(t *testing.T) {
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
t.Fatalf("decode request: %v", err)
}
if req.AnthropicVersion != "2023-06-01" {
t.Errorf("expected anthropic_version in request")
if req.MaxTokens == 0 {
t.Errorf("expected max_tokens in request")
}
if req.System != "You are helpful" {
t.Errorf("expected system prompt: %q", req.System)
3