api

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EstimateTokens

func EstimateTokens(functionContent string, routes string) int

EstimateTokens estimates the number of tokens for generating Swagger comments.

Types

type Client

type Client interface {
	GenerateSwaggerComment(functionName, functionContent, model string, routeString string) (string, error)
}

Client is an interface representing the OpenAI client.

type OpenAIClient

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

OpenAIClient is a struct that implements the Client interface.

func NewOpenAIClient

func NewOpenAIClient(apiKey string) *OpenAIClient

NewOpenAIClient initializes and returns an OpenAI client.

func (*OpenAIClient) GenerateSwaggerComment

func (c *OpenAIClient) GenerateSwaggerComment(functionName, functionContent, model string, routeString string) (string, error)

GenerateSwaggerComment generates Swagger comments using OpenAI API.

Jump to

Keyboard shortcuts

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