openaiapi

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 5, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client represents OpenAI API client

func New

func New(log *zap.Logger, conf appconf.OpenAI) *Client

New creates new OpenAI client

func (*Client) AnalyzeGameImages

func (c *Client) AnalyzeGameImages(ctx context.Context, gameData model.ModerationData) (*VisionAnalysisResult, error)

AnalyzeGameImages analyzes images for gaming-specific content appropriateness using vision model

func (*Client) ModerateText

func (c *Client) ModerateText(ctx context.Context, gameData model.ModerationData) (*ModerationResponse, error)

ModerateText performs basic text and image moderation using OpenAI moderation API

type ModerationResponse

type ModerationResponse struct {
	ID      string             `json:"id"`
	Results []ModerationResult `json:"results"`
}

ModerationResponse represents OpenAI moderation API response

type ModerationResult

type ModerationResult struct {
	Flagged    bool     `json:"flagged"`
	Categories []string `json:"categories"`
}

ModerationResult represents moderation result for single input

type VisionAnalysisResult

type VisionAnalysisResult struct {
	Approved          bool   `json:"approved"`
	Reason            string `json:"reason"`
	GamingAppropriate bool   `json:"gaming_appropriate"`
	ContentRelevant   bool   `json:"content_relevant"`
}

VisionAnalysisResult represents the result from vision model image analysis

Jump to

Keyboard shortcuts

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