chatgpt

package
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 14, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

README

ChatGPT

chatgpt.query

This action provides a summary and suggested response to a security alert using ChatGPT.

Prerequisite

  1. Create an account on OpenAI.
  2. Generate an API key at https://platform.openai.com/account/api-keys.
Arguments

Example policy:

run contains res if {
  res := {
    "id": "your-action",
    "uses": "chatgpt.query",
    "args": {
      "secret_api_key": input.env.CHATGPT_API_KEY,
    },
  },
}
  • secret_api_key (required, string): The API key for OpenAI.
  • prompt (optional, string): The ChatGPT prompt. The default is:
Please analyze and summarize the given JSON-formatted security alert data, and suggest appropriate actions for the security administrator to respond to the alert:

and stringified JSON-formatted security alert data.

Response

The response format follows the OpenAI Chat API guidelines, which can be found at: https://platform.openai.com/docs/guides/chat/response-format

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Query

func Query(ctx context.Context, alert model.Alert, args model.ActionArgs) (any, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL