tooling

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const BuildCodeToolName = "build_code"
View Source
const GenerateHandlersCodeToolName = "generate_handlers_code"
View Source
const GenerateOpenAPISpecToolName = "generate_openapi_spec"
View Source
const GenerateSchemaToolName = "generate_schema"
View Source
const GenerateServerCodeToolName = "generate_server_code"
View Source
const ListTablesToolName = "list_tables"
View Source
const QueryKnowledgeBaseToolName = "query_knowledge_base"
View Source
const QueryMemoryToolName = "query_memory"
View Source
const SaveServerCodeToolName = "save_server_code"
View Source
const StoreSchemaToolName = "store_schema"

Variables

This section is empty.

Functions

func TrimNonCode added in v0.0.7

func TrimNonCode(text, typ string) string

Types

type Agent added in v0.0.7

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

func (*Agent) Run added in v0.0.7

func (a *Agent) Run(ctx context.Context) string

func (*Agent) WithModel added in v0.0.7

func (a *Agent) WithModel(model string) *Agent

func (*Agent) WithTools added in v0.0.7

func (a *Agent) WithTools(tools ...openai.ChatCompletionToolParam) *Agent

type Column

type Column struct {
	Name        string `json:"name"`
	Type        string `json:"type"`
	Constraints string `json:"constraints"`
}

type Schema

type Schema struct {
	TableName string   `json:"table_name"`
	Columns   []Column `json:"columns"`
}

type Service

type Service struct {
	DB        *sqlx.DB
	KS        *vector.KnowledgeService
	Mem       *vector.MemoryService
	OpenAICli *openai.Client
	ChatModel string
	CodeModel string
	TmpDir    string
}

func New

func (*Service) Agent added in v0.0.7

func (s *Service) Agent(prompt, userInput string) *Agent

func (*Service) BuildCode added in v0.0.2

func (s *Service) BuildCode(ctx context.Context) string

func (*Service) BuildCodeTool added in v0.0.2

func (s *Service) BuildCodeTool() openai.ChatCompletionToolParam

func (*Service) Clear added in v0.0.2

func (s *Service) Clear()

func (*Service) GenerateHandlersCode added in v0.0.2

func (s *Service) GenerateHandlersCode(ctx context.Context) string

func (*Service) GenerateHandlersCodeTool added in v0.0.2

func (s *Service) GenerateHandlersCodeTool() openai.ChatCompletionToolParam

func (*Service) GenerateOpenAPISpec added in v0.0.2

func (s *Service) GenerateOpenAPISpec(ctx context.Context, arguments string) string

func (*Service) GenerateOpenAPISpecTool added in v0.0.2

func (s *Service) GenerateOpenAPISpecTool() openai.ChatCompletionToolParam

func (*Service) GenerateSchema

func (s *Service) GenerateSchema(ctx context.Context, arguments string) string

func (*Service) GenerateSchemaTool

func (s *Service) GenerateSchemaTool() openai.ChatCompletionToolParam

func (*Service) GenerateServerCode added in v0.0.5

func (s *Service) GenerateServerCode(ctx context.Context, arguments string) string

func (*Service) GenerateServerCodeTool added in v0.0.5

func (s *Service) GenerateServerCodeTool() openai.ChatCompletionToolParam

func (*Service) HandleToolCall added in v0.0.7

func (*Service) ListTables

func (s *Service) ListTables(ctx context.Context) string

func (*Service) ListTablesTool

func (s *Service) ListTablesTool() openai.ChatCompletionToolParam

func (*Service) QueryKnowledgeBase added in v0.0.3

func (s *Service) QueryKnowledgeBase(ctx context.Context, arguments string) string

func (*Service) QueryKnowledgeBaseTool added in v0.0.3

func (s *Service) QueryKnowledgeBaseTool() openai.ChatCompletionToolParam

func (*Service) QueryMemory added in v0.0.7

func (s *Service) QueryMemory(ctx context.Context, arguments string) string

func (*Service) QueryMemoryTool added in v0.0.7

func (s *Service) QueryMemoryTool() openai.ChatCompletionToolParam

func (*Service) SaveServerCode added in v0.0.5

func (s *Service) SaveServerCode(_ context.Context, arguments string) string

func (*Service) SaveServerCodeTool added in v0.0.5

func (s *Service) SaveServerCodeTool() openai.ChatCompletionToolParam

func (*Service) StoreSchema

func (s *Service) StoreSchema(ctx context.Context, arguments string) string

func (*Service) StoreSchemaTool

func (s *Service) StoreSchemaTool() openai.ChatCompletionToolParam

Jump to

Keyboard shortcuts

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