cmd

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: BSD-2-Clause, Unlicense Imports: 48 Imported by: 0

Documentation

Overview

Copyright © 2024 NAME HERE <EMAIL ADDRESS>

Copyright © 2024 NAME HERE <EMAIL ADDRESS>

Copyright © 2024 NAME HERE <EMAIL ADDRESS>

Copyright © 2024 NAME HERE <EMAIL ADDRESS>

Copyright © 2024 NAME HERE <EMAIL ADDRESS>

Copyright © 2024 NAME HERE <EMAIL ADDRESS>

Copyright © 2023 NAME HERE <EMAIL ADDRESS>

Copyright © 2024 NAME HERE <EMAIL ADDRESS>

Copyright © 2024 NAME HERE <EMAIL ADDRESS>

Copyright © 2024 NAME HERE <EMAIL ADDRESS>

Copyright © 2024 NAME HERE <EMAIL ADDRESS>

Copyright © 2024 NAME HERE <EMAIL ADDRESS>

Copyright © 2023 NAME HERE <EMAIL ADDRESS>

Copyright © 2023 NAME HERE <EMAIL ADDRESS>

Copyright © 2024 NAME HERE <EMAIL ADDRESS>

Copyright © 2024 NAME HERE <EMAIL ADDRESS>

Copyright © 2024 NAME HERE <EMAIL ADDRESS>

Copyright © 2024 NAME HERE <EMAIL ADDRESS>

Copyright © 2024 NAME HERE <EMAIL ADDRESS>

Copyright © 2024 NAME HERE <EMAIL ADDRESS>

Copyright © 2024 NAME HERE <EMAIL ADDRESS>

Copyright © 2024 NAME HERE <EMAIL ADDRESS>

Copyright © 2024 NAME HERE <EMAIL ADDRESS>

Copyright © 2024 NAME HERE <EMAIL ADDRESS>

Index

Constants

This section is empty.

Variables

View Source
var (
	RUNNER_type      string
	RUNNER_name      string
	RUNNER_data_root string
)
View Source
var GLOBAL_control_user string

TODO: This is context that needs to be passed down to the subcommands, for now, I'm working on something else and just need the functionality, but I'm sure there is a more correct way to do this.

View Source
var UpdateConfig = struct {
	do_python         bool
	do_core_tool      bool
	accept_prerelease bool
}{}
View Source
var VERSION_string string

Functions

func AutodevDebugError

func AutodevDebugError(autodev_config *autodev.AutodevConfig)

func AutodevEntrypoint

func AutodevEntrypoint(cmd *cobra.Command, args []string)

func CleanupDocker

func CleanupDocker(dockerfile_path string) error

func Compile

func Compile(args []string)

func ControlCreateAgent

func ControlCreateAgent(control_config *ControlConfig, args []string)

func ControlPost

func ControlPost(control_config *ControlConfig, args []string)

func DoGoUpdate

func DoGoUpdate() error

func DoPythonUpdate

func DoPythonUpdate() error

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

func GenerateControllerConfig

func GenerateControllerConfig(cmd *cobra.Command, args []string)

func GenerateCoreUtils

func GenerateCoreUtils(cmd *cobra.Command, args []string)

GenerateCoreUtils creates a core utilities directory for the Python client API in the core project directory.

func GenerateEntrypoint

func GenerateEntrypoint(cmd *cobra.Command, args []string)

GenerateEntrypoint runs the Usage function when a subcommand is not used with `core generate`.

func GenerateGoAgent

func GenerateGoAgent(cmd *cobra.Command, args []string, config *GenerateConfig)

GenerateGoAgent creates a new standalone Go agent in the core project directory.

func GeneratePythonAgent

func GeneratePythonAgent(cmd *cobra.Command, args []string, config *GenerateConfig)

GeneratePython agent creates a new Python agent in the core project directory.

func GetRunnerName

func GetRunnerName() string

func Green

func Green(in string) string

func HasSpec

func HasSpec(agent_dir string) bool

func ImageExists

func ImageExists(dockerfile_path string) (exists bool, err error)

func ParseDockerfileDependencies

func ParseDockerfileDependencies(config *autodev.AutodevConfig, ctx context.Context, model *genai.GenerativeModel, dockerfile_code string) ([]string, []string, error)

ParseDockerfileDependencies parses all system and Python dependencies.

func ParsePythonScriptImports

func ParsePythonScriptImports(config *autodev.AutodevConfig, ctx context.Context, model *genai.GenerativeModel, python_code string) ([]string, error)

ParsePythonScriptImports parses all Python-based agent code and extracts imported packages.

func PromptYesNo

func PromptYesNo(message string) bool

func Red

func Red(in string) string

func Run

func Run(args []string)

Run runs agents in a core project. It supports Python and Go agents.

func StartMAS

func StartMAS(args []string)

func StartRunner

func StartRunner(args []string)

func StartServer

func StartServer(cmd *cobra.Command, args []string)

StartServer launches a core blackboard server on a specified address.

func UpdateDockerfile

func UpdateDockerfile(config *autodev.AutodevConfig, ctx context.Context, model *genai.GenerativeModel, path string, py_deps []string) error

UpdateDockerfile updates the pip install portion of a Dockerfile and saves to disk.

NOTE: As of right now, only Python packages need to be handled by UpdateDockerfile, and we assume the user isn't using micromamba/conda to manage their dependencies. If they are, we put the onus of dependency management back onto the user. This seems to be fair because we are handling the most basic use-case: a call to pip install from the Dockerfile, which is likely how a lay-user would initially attempt to write their Dockerfile.

func UsesMamba

func UsesMamba(dockerfile string) bool

UsesMamba checks whether the agent Dockerfile uses micromamba/conda for package and environment management for Python agents.

Types

type CompileFunc

type CompileFunc func() CompileResult

func GetCompileFunction

func GetCompileFunction(agent_dir_name string) CompileFunc

NOTE: Every agent will determine what compilation to run via this function. All heuristics for determining what sort of agent we're trying to compile must go here. In no uncertain terms: docker should be the preferred approach for all agents eventually. This function essentially enforces the opinions of the developers (John and Josh) about what best practices are for agents. We return functions here to give more control over how and where they are called (i.e. allow for easy calling inside of a goroutine)

type CompileResult

type CompileResult struct {
	Type         CompileType
	Status       CompileStatus
	BuildContext string // using docker terminology here, but this just means the root build directory
	Error        error
	BuildMessage string // Summary of what happened and how to get help (if needed)
	Stdout       []byte
	Stderr       []byte
}

func CompileDocker

func CompileDocker(dockerfile_path string) (compile_result CompileResult)

CompileDocker builds a Docker image for the agent on the current machine

func CompileGo

func CompileGo(project_path string) CompileResult

func CompilePython

func CompilePython() CompileResult

func SkipCompile

func SkipCompile(message string) CompileResult

func (CompileResult) TableHeader

func (c CompileResult) TableHeader() string

func (CompileResult) TableString

func (c CompileResult) TableString() string

type CompileStatus

type CompileStatus int

NOTE: Compiler functions. Adding new compilation mechanisms should be done here.

const (
	CompileStatusSuccess CompileStatus = iota
	CompileStatusFailure
)

func (CompileStatus) String

func (i CompileStatus) String() string

type CompileType

type CompileType int

NOTE: Compiler functions. Adding new compilation mechanisms should be done here.

const (
	CompileTypeSkipped CompileType = iota
	CompileTypeDocker
	CompileTypeGo
	CompileTypePython
)

func (CompileType) String

func (i CompileType) String() string

type ControlConfig

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

ControlConfig is a convenience structure for the control command. NOTE: I think we may still occasionally a more global configuration structure. In this case, there's context that we want to ensure that the subcommands have (such as if the control user wants to set a specific username other than )

type GenerateConfig

type GenerateConfig struct {
	AgentName string
	UseGPU    bool
	LowLevel  bool
}

Directories

Path Synopsis
A simple agent that notices blackboard changing
A simple agent that notices blackboard changing
client-apis
go
This is intended to be a light wrapper to make automatically loading context easier to configure with yaml or json
This is intended to be a light wrapper to make automatically loading context easier to configure with yaml or json

Jump to

Keyboard shortcuts

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