core

package
v0.0.4 Latest Latest
Warning

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

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

Documentation

Overview

Package core provides primitives to interact with the openapi HTTP API.

Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.5.1 DO NOT EDIT.

Package core provides primitives to interact with the openapi HTTP API.

Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.5.1 DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterHandlers

func RegisterHandlers(router gin.IRouter, si ServerInterface)

RegisterHandlers creates http.Handler with routing matching OpenAPI spec.

func RegisterHandlersWithOptions

func RegisterHandlersWithOptions(router gin.IRouter, si ServerInterface, options GinServerOptions)

RegisterHandlersWithOptions creates http.Handler with additional options

Types

type AddPromptJSONBody

type AddPromptJSONBody struct {
	Content string `json:"content"`

	// Format Output format of the prompt execution
	Format AddPromptJSONBodyFormat `json:"format"`

	// FormatInstructions Instructions for the LLM on how to format the output
	FormatInstructions string   `json:"formatInstructions"`
	Name               string   `json:"name"`
	Parameters         []string `json:"parameters"`

	// SampleParameters Example parameter values for the prompt
	SampleParameters *map[string]string `json:"sampleParameters,omitempty"`
	Tags             []string           `json:"tags"`
}

AddPromptJSONBody defines parameters for AddPrompt.

type AddPromptJSONBodyFormat

type AddPromptJSONBodyFormat string

AddPromptJSONBodyFormat defines parameters for AddPrompt.

const (
	AddPromptJSONBodyFormatJson     AddPromptJSONBodyFormat = "json"
	AddPromptJSONBodyFormatMarkdown AddPromptJSONBodyFormat = "markdown"
	AddPromptJSONBodyFormatText     AddPromptJSONBodyFormat = "text"
)

Defines values for AddPromptJSONBodyFormat.

type AddPromptJSONRequestBody

type AddPromptJSONRequestBody AddPromptJSONBody

AddPromptJSONRequestBody defines body for AddPrompt for application/json ContentType.

type BasicEntity

type BasicEntity struct {
	Icon *string            `json:"icon,omitempty"`
	Id   openapi_types.UUID `json:"id"`
	Name string             `json:"name"`
}

BasicEntity defines model for BasicEntity.

type ErrorSchema

type ErrorSchema struct {
	Code    int32  `json:"code"`
	Message string `json:"message"`
}

ErrorSchema defines model for ErrorSchema.

type ExecutePromptJSONBody

type ExecutePromptJSONBody struct {
	// Content Override the prompt with a custom prompt. Used for tests.
	Content *string `json:"content,omitempty"`

	// Format Override the output format. Used for tests.
	Format *ExecutePromptJSONBodyFormat `json:"format,omitempty"`

	// FormatInstructions Override the format instructions with custom instructions. Used for tests.
	FormatInstructions *string `json:"formatInstructions,omitempty"`

	// Parameters Override the parameters with a custom list of parameters. Used for tests.
	Parameters       *[]string          `json:"parameters,omitempty"`
	ParametersValues *map[string]string `json:"parametersValues,omitempty"`
}

ExecutePromptJSONBody defines parameters for ExecutePrompt.

type ExecutePromptJSONBodyFormat

type ExecutePromptJSONBodyFormat string

ExecutePromptJSONBodyFormat defines parameters for ExecutePrompt.

const (
	ExecutePromptJSONBodyFormatJson     ExecutePromptJSONBodyFormat = "json"
	ExecutePromptJSONBodyFormatMarkdown ExecutePromptJSONBodyFormat = "markdown"
	ExecutePromptJSONBodyFormatText     ExecutePromptJSONBodyFormat = "text"
)

Defines values for ExecutePromptJSONBodyFormat.

type ExecutePromptJSONRequestBody

type ExecutePromptJSONRequestBody ExecutePromptJSONBody

ExecutePromptJSONRequestBody defines body for ExecutePrompt for application/json ContentType.

type ExecutePromptParams

type ExecutePromptParams struct {
	// Id ID of prompt to execute
	Id *openapi_types.UUID `form:"id,omitempty" json:"id,omitempty"`

	// Name Name of prompt to execute
	Name *string `form:"name,omitempty" json:"name,omitempty"`

	// Provider LLM Provider
	Provider *ExecutePromptParamsProvider `form:"provider,omitempty" json:"provider,omitempty"`

	// Llm LLM to use for execution
	Llm *string `form:"llm,omitempty" json:"llm,omitempty"`

	// MaxTokens Maximum number of tokens to generate
	MaxTokens *int32 `form:"maxTokens,omitempty" json:"maxTokens,omitempty"`

	// Temperature Temperature for LLM generation (0.0-1.0)
	Temperature *float32 `form:"temperature,omitempty" json:"temperature,omitempty"`
}

ExecutePromptParams defines parameters for ExecutePrompt.

type ExecutePromptParamsProvider

type ExecutePromptParamsProvider string

ExecutePromptParamsProvider defines parameters for ExecutePrompt.

const (
	ANTHROPIC ExecutePromptParamsProvider = "ANTHROPIC"
	GOOGLEAI  ExecutePromptParamsProvider = "GOOGLEAI"
	MISTRAL   ExecutePromptParamsProvider = "MISTRAL"
	OLLAMA    ExecutePromptParamsProvider = "OLLAMA"
	OPENAI    ExecutePromptParamsProvider = "OPENAI"
)

Defines values for ExecutePromptParamsProvider.

type FormatPromptJSONBody

type FormatPromptJSONBody struct {
	Parameters *map[string]string `json:"parameters,omitempty"`
}

FormatPromptJSONBody defines parameters for FormatPrompt.

type FormatPromptJSONRequestBody

type FormatPromptJSONRequestBody FormatPromptJSONBody

FormatPromptJSONRequestBody defines body for FormatPrompt for application/json ContentType.

type FormatPromptParams

type FormatPromptParams struct {
	// Id ID of prompt to execute
	Id *openapi_types.UUID `form:"id,omitempty" json:"id,omitempty"`

	// Name Name of prompt to execute
	Name *string `form:"name,omitempty" json:"name,omitempty"`
}

FormatPromptParams defines parameters for FormatPrompt.

type GinServerOptions

type GinServerOptions struct {
	BaseURL      string
	Middlewares  []MiddlewareFunc
	ErrorHandler func(*gin.Context, error, int)
}

GinServerOptions provides options for the Gin server.

type InternalServerError

type InternalServerError struct {
	Error   *string `json:"error,omitempty"`
	Message *string `json:"message,omitempty"`
}

InternalServerError defines model for InternalServerError.

type ListPromptsParams

type ListPromptsParams struct {
	// Page page number
	Page *int32 `form:"page,omitempty" json:"page,omitempty"`

	// PageSize maximum number of results to return
	PageSize *int32 `form:"pageSize,omitempty" json:"pageSize,omitempty"`

	// SortBy field to sort by
	SortBy *string `form:"sortBy,omitempty" json:"sortBy,omitempty"`

	// Order sort order
	Order *ListPromptsParamsOrder `form:"order,omitempty" json:"order,omitempty"`

	// Tags tags to filter by
	Tags *[]string `form:"tags,omitempty" json:"tags,omitempty"`

	// Q starts with
	Q *string `form:"q,omitempty" json:"q,omitempty"`

	// Detail basic or full
	Detail *string `form:"detail,omitempty" json:"detail,omitempty"`
}

ListPromptsParams defines parameters for ListPrompts.

type ListPromptsParamsOrder

type ListPromptsParamsOrder string

ListPromptsParamsOrder defines parameters for ListPrompts.

const (
	Asc  ListPromptsParamsOrder = "asc"
	Desc ListPromptsParamsOrder = "desc"
)

Defines values for ListPromptsParamsOrder.

type MiddlewareFunc

type MiddlewareFunc func(c *gin.Context)

type NewPrompt

type NewPrompt struct {
	Content string `json:"content"`

	// Format Output format of the prompt execution
	Format NewPromptFormat `json:"format"`

	// FormatInstructions Instructions for the LLM on how to format the output
	FormatInstructions string   `json:"formatInstructions"`
	Name               string   `json:"name"`
	Parameters         []string `json:"parameters"`

	// SampleParameters Example parameter values for the prompt
	SampleParameters *map[string]string `json:"sampleParameters,omitempty"`
	Tags             []string           `json:"tags"`
}

NewPrompt defines model for NewPrompt.

type NewPromptFormat

type NewPromptFormat string

NewPromptFormat Output format of the prompt execution

const (
	NewPromptFormatJson     NewPromptFormat = "json"
	NewPromptFormatMarkdown NewPromptFormat = "markdown"
	NewPromptFormatText     NewPromptFormat = "text"
)

Defines values for NewPromptFormat.

type Prompt

type Prompt struct {
	Content string `json:"content"`

	// Format Output format of the prompt execution
	Format PromptFormat `json:"format"`

	// FormatInstructions Instructions for the LLM on how to format the output
	FormatInstructions string             `json:"formatInstructions"`
	Id                 openapi_types.UUID `json:"id"`
	Name               string             `json:"name"`
	Parameters         []string           `json:"parameters"`

	// SampleParameters Example parameter values for the prompt
	SampleParameters *map[string]string `json:"sampleParameters,omitempty"`
	Tags             []string           `json:"tags"`
}

Prompt defines model for Prompt.

type PromptFormat

type PromptFormat string

PromptFormat Output format of the prompt execution

const (
	PromptFormatJson     PromptFormat = "json"
	PromptFormatMarkdown PromptFormat = "markdown"
	PromptFormatText     PromptFormat = "text"
)

Defines values for PromptFormat.

type PromptResponse

type PromptResponse struct {
	Result string `json:"result"`
}

PromptResponse defines model for PromptResponse.

type ServerInterface

type ServerInterface interface {

	// (GET /api/v1/prompts)
	ListPrompts(c *gin.Context, params ListPromptsParams)

	// (POST /api/v1/prompts)
	AddPrompt(c *gin.Context)

	// (POST /api/v1/prompts/execute)
	ExecutePrompt(c *gin.Context, params ExecutePromptParams)

	// (POST /api/v1/prompts/format)
	FormatPrompt(c *gin.Context, params FormatPromptParams)

	// (DELETE /api/v1/prompts/{id})
	DeletePrompt(c *gin.Context, id openapi_types.UUID)

	// (GET /api/v1/prompts/{id})
	GetPromptByID(c *gin.Context, id openapi_types.UUID)

	// (PUT /api/v1/prompts/{id})
	UpdatePrompt(c *gin.Context, id openapi_types.UUID)
}

ServerInterface represents all server handlers.

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler            ServerInterface
	HandlerMiddlewares []MiddlewareFunc
	ErrorHandler       func(*gin.Context, error, int)
}

ServerInterfaceWrapper converts contexts to parameters.

func (*ServerInterfaceWrapper) AddPrompt

func (siw *ServerInterfaceWrapper) AddPrompt(c *gin.Context)

AddPrompt operation middleware

func (*ServerInterfaceWrapper) DeletePrompt

func (siw *ServerInterfaceWrapper) DeletePrompt(c *gin.Context)

DeletePrompt operation middleware

func (*ServerInterfaceWrapper) ExecutePrompt

func (siw *ServerInterfaceWrapper) ExecutePrompt(c *gin.Context)

ExecutePrompt operation middleware

func (*ServerInterfaceWrapper) FormatPrompt

func (siw *ServerInterfaceWrapper) FormatPrompt(c *gin.Context)

FormatPrompt operation middleware

func (*ServerInterfaceWrapper) GetPromptByID

func (siw *ServerInterfaceWrapper) GetPromptByID(c *gin.Context)

GetPromptByID operation middleware

func (*ServerInterfaceWrapper) ListPrompts

func (siw *ServerInterfaceWrapper) ListPrompts(c *gin.Context)

ListPrompts operation middleware

func (*ServerInterfaceWrapper) UpdatePrompt

func (siw *ServerInterfaceWrapper) UpdatePrompt(c *gin.Context)

UpdatePrompt operation middleware

type UnauthorizedError

type UnauthorizedError struct {
	Error   *string `json:"error,omitempty"`
	Message *string `json:"message,omitempty"`
}

UnauthorizedError defines model for UnauthorizedError.

type UpdatePromptJSONBody

type UpdatePromptJSONBody struct {
	Content string `json:"content"`

	// Format Output format of the prompt execution
	Format UpdatePromptJSONBodyFormat `json:"format"`

	// FormatInstructions Instructions for the LLM on how to format the output
	FormatInstructions string             `json:"formatInstructions"`
	Id                 openapi_types.UUID `json:"id"`
	Name               string             `json:"name"`
	Parameters         []string           `json:"parameters"`

	// SampleParameters Example parameter values for the prompt
	SampleParameters *map[string]string `json:"sampleParameters,omitempty"`
	Tags             []string           `json:"tags"`
}

UpdatePromptJSONBody defines parameters for UpdatePrompt.

type UpdatePromptJSONBodyFormat

type UpdatePromptJSONBodyFormat string

UpdatePromptJSONBodyFormat defines parameters for UpdatePrompt.

const (
	Json     UpdatePromptJSONBodyFormat = "json"
	Markdown UpdatePromptJSONBodyFormat = "markdown"
	Text     UpdatePromptJSONBodyFormat = "text"
)

Defines values for UpdatePromptJSONBodyFormat.

type UpdatePromptJSONRequestBody

type UpdatePromptJSONRequestBody UpdatePromptJSONBody

UpdatePromptJSONRequestBody defines body for UpdatePrompt for application/json ContentType.

Jump to

Keyboard shortcuts

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