diff --git a/CHANGELOG.md b/CHANGELOG.md index a5036b1..92016bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Redact: `Unredact()` method on service interface. - Redact: `FPEContext` on `RedactResult` and `StructuredResult`. +### Removed + +- AI Guard: `LlmInfo` and `LlmInput`. + ## 4.4.0 - 2025-02-16 ### Added diff --git a/pangea-sdk/service/ai_guard/api.go b/pangea-sdk/service/ai_guard/api.go index dda7e37..c3f736c 100644 --- a/pangea-sdk/service/ai_guard/api.go +++ b/pangea-sdk/service/ai_guard/api.go @@ -19,8 +19,8 @@ import ( // input := &ai_guard.TextGuardRequest{Text: "hello world"} // response, err := client.GuardText(ctx, input) func (e *aiGuard) GuardText(ctx context.Context, input *TextGuardRequest) (*pangea.PangeaResponse[TextGuardResult], error) { - if input.Text == "" && input.Messages == nil && input.LlmInput == nil { - return nil, errors.New("one of `text`, `messages`, or `llm_input` must be defined") + if input.Text == "" && input.Messages == nil { + return nil, errors.New("one of `Text` or `Messages` must be defined") } return request.DoPost(ctx, e.Client, "v1/text/guard", input, &TextGuardResult{}) @@ -110,10 +110,8 @@ type TextGuardRequest struct { Text string `json:"text,omitempty"` // Text to be scanned by AI Guard for PII, sensitive data, malicious content, and other data types defined by the configuration. Supports processing up to 10KB of text. Messages any `json:"messages,omitempty"` // Structured messages data to be scanned by AI Guard for PII, sensitive data, malicious content, and other data types defined by the configuration. Supports processing up to 10KB of JSON text. - LlmInput any `json:"llm_input,omitempty"` // Structured full llm payload data to be scanned by AI Guard for PII, sensitive data, malicious content, and other data types defined by the configuration. Supports processing up to 10KB of JSON text. Recipe string `json:"recipe,omitempty"` // Recipe key of a configuration of data types and settings defined in the Pangea User Console. It specifies the rules that are to be applied to the text, such as defang malicious URLs. Debug bool `json:"debug,omitempty"` // Setting this value to true will provide a detailed analysis of the text data - LlmInfo string `json:"llm_info,omitempty"` // Short string hint for the LLM Provider information LogFields LogFields `json:"log_fields,omitempty"` // Additional fields to include in activity log } diff --git a/pangea-sdk/service/ai_guard/integration_test.go b/pangea-sdk/service/ai_guard/integration_test.go index b46f190..ed0da53 100644 --- a/pangea-sdk/service/ai_guard/integration_test.go +++ b/pangea-sdk/service/ai_guard/integration_test.go @@ -51,24 +51,3 @@ func TestTextGuard_Messages(t *testing.T) { assert.NotNil(t, out.Result) assert.NotNil(t, out.Result.PromptMessages) } - -func TestTextGuard_Llm_Input(t *testing.T) { - ctx, cancelFn := context.WithTimeout(context.Background(), 5*time.Second) - defer cancelFn() - - client := ai_guard.New(pangeatesting.IntegrationConfig(t, testingEnvironment)) - - input := &ai_guard.TextGuardRequest{LlmInput: map[string]interface{}{ - "model": "gpt-4o", - "messages": []map[string]interface{}{ - { - "role": "user", - "content": "what was pangea?", - }, - }, - }} - out, err := client.GuardText(ctx, input) - assert.NoError(t, err) - assert.NotNil(t, out.Result) - assert.NotNil(t, out.Result.PromptMessages) -}