wip(agent-builder): im not sure sure this is actually a good idea
This commit is contained in:
78
backend/.gen/haystack/agents/table/agents.go
Normal file
78
backend/.gen/haystack/agents/table/agents.go
Normal file
@@ -0,0 +1,78 @@
|
||||
//
|
||||
// Code generated by go-jet DO NOT EDIT.
|
||||
//
|
||||
// WARNING: Changes to this file may cause incorrect behavior
|
||||
// and will be lost if the code is regenerated
|
||||
//
|
||||
|
||||
package table
|
||||
|
||||
import (
|
||||
"github.com/go-jet/jet/v2/postgres"
|
||||
)
|
||||
|
||||
var Agents = newAgentsTable("agents", "agents", "")
|
||||
|
||||
type agentsTable struct {
|
||||
postgres.Table
|
||||
|
||||
// Columns
|
||||
ID postgres.ColumnString
|
||||
Name postgres.ColumnString
|
||||
|
||||
AllColumns postgres.ColumnList
|
||||
MutableColumns postgres.ColumnList
|
||||
}
|
||||
|
||||
type AgentsTable struct {
|
||||
agentsTable
|
||||
|
||||
EXCLUDED agentsTable
|
||||
}
|
||||
|
||||
// AS creates new AgentsTable with assigned alias
|
||||
func (a AgentsTable) AS(alias string) *AgentsTable {
|
||||
return newAgentsTable(a.SchemaName(), a.TableName(), alias)
|
||||
}
|
||||
|
||||
// Schema creates new AgentsTable with assigned schema name
|
||||
func (a AgentsTable) FromSchema(schemaName string) *AgentsTable {
|
||||
return newAgentsTable(schemaName, a.TableName(), a.Alias())
|
||||
}
|
||||
|
||||
// WithPrefix creates new AgentsTable with assigned table prefix
|
||||
func (a AgentsTable) WithPrefix(prefix string) *AgentsTable {
|
||||
return newAgentsTable(a.SchemaName(), prefix+a.TableName(), a.TableName())
|
||||
}
|
||||
|
||||
// WithSuffix creates new AgentsTable with assigned table suffix
|
||||
func (a AgentsTable) WithSuffix(suffix string) *AgentsTable {
|
||||
return newAgentsTable(a.SchemaName(), a.TableName()+suffix, a.TableName())
|
||||
}
|
||||
|
||||
func newAgentsTable(schemaName, tableName, alias string) *AgentsTable {
|
||||
return &AgentsTable{
|
||||
agentsTable: newAgentsTableImpl(schemaName, tableName, alias),
|
||||
EXCLUDED: newAgentsTableImpl("", "excluded", ""),
|
||||
}
|
||||
}
|
||||
|
||||
func newAgentsTableImpl(schemaName, tableName, alias string) agentsTable {
|
||||
var (
|
||||
IDColumn = postgres.StringColumn("id")
|
||||
NameColumn = postgres.StringColumn("name")
|
||||
allColumns = postgres.ColumnList{IDColumn, NameColumn}
|
||||
mutableColumns = postgres.ColumnList{NameColumn}
|
||||
)
|
||||
|
||||
return agentsTable{
|
||||
Table: postgres.NewTable(schemaName, tableName, alias, allColumns...),
|
||||
|
||||
//Columns
|
||||
ID: IDColumn,
|
||||
Name: NameColumn,
|
||||
|
||||
AllColumns: allColumns,
|
||||
MutableColumns: mutableColumns,
|
||||
}
|
||||
}
|
||||
81
backend/.gen/haystack/agents/table/system_prompts.go
Normal file
81
backend/.gen/haystack/agents/table/system_prompts.go
Normal file
@@ -0,0 +1,81 @@
|
||||
//
|
||||
// Code generated by go-jet DO NOT EDIT.
|
||||
//
|
||||
// WARNING: Changes to this file may cause incorrect behavior
|
||||
// and will be lost if the code is regenerated
|
||||
//
|
||||
|
||||
package table
|
||||
|
||||
import (
|
||||
"github.com/go-jet/jet/v2/postgres"
|
||||
)
|
||||
|
||||
var SystemPrompts = newSystemPromptsTable("agents", "system_prompts", "")
|
||||
|
||||
type systemPromptsTable struct {
|
||||
postgres.Table
|
||||
|
||||
// Columns
|
||||
ID postgres.ColumnString
|
||||
Prompt postgres.ColumnString
|
||||
AgentID postgres.ColumnString
|
||||
|
||||
AllColumns postgres.ColumnList
|
||||
MutableColumns postgres.ColumnList
|
||||
}
|
||||
|
||||
type SystemPromptsTable struct {
|
||||
systemPromptsTable
|
||||
|
||||
EXCLUDED systemPromptsTable
|
||||
}
|
||||
|
||||
// AS creates new SystemPromptsTable with assigned alias
|
||||
func (a SystemPromptsTable) AS(alias string) *SystemPromptsTable {
|
||||
return newSystemPromptsTable(a.SchemaName(), a.TableName(), alias)
|
||||
}
|
||||
|
||||
// Schema creates new SystemPromptsTable with assigned schema name
|
||||
func (a SystemPromptsTable) FromSchema(schemaName string) *SystemPromptsTable {
|
||||
return newSystemPromptsTable(schemaName, a.TableName(), a.Alias())
|
||||
}
|
||||
|
||||
// WithPrefix creates new SystemPromptsTable with assigned table prefix
|
||||
func (a SystemPromptsTable) WithPrefix(prefix string) *SystemPromptsTable {
|
||||
return newSystemPromptsTable(a.SchemaName(), prefix+a.TableName(), a.TableName())
|
||||
}
|
||||
|
||||
// WithSuffix creates new SystemPromptsTable with assigned table suffix
|
||||
func (a SystemPromptsTable) WithSuffix(suffix string) *SystemPromptsTable {
|
||||
return newSystemPromptsTable(a.SchemaName(), a.TableName()+suffix, a.TableName())
|
||||
}
|
||||
|
||||
func newSystemPromptsTable(schemaName, tableName, alias string) *SystemPromptsTable {
|
||||
return &SystemPromptsTable{
|
||||
systemPromptsTable: newSystemPromptsTableImpl(schemaName, tableName, alias),
|
||||
EXCLUDED: newSystemPromptsTableImpl("", "excluded", ""),
|
||||
}
|
||||
}
|
||||
|
||||
func newSystemPromptsTableImpl(schemaName, tableName, alias string) systemPromptsTable {
|
||||
var (
|
||||
IDColumn = postgres.StringColumn("id")
|
||||
PromptColumn = postgres.StringColumn("prompt")
|
||||
AgentIDColumn = postgres.StringColumn("agent_id")
|
||||
allColumns = postgres.ColumnList{IDColumn, PromptColumn, AgentIDColumn}
|
||||
mutableColumns = postgres.ColumnList{PromptColumn, AgentIDColumn}
|
||||
)
|
||||
|
||||
return systemPromptsTable{
|
||||
Table: postgres.NewTable(schemaName, tableName, alias, allColumns...),
|
||||
|
||||
//Columns
|
||||
ID: IDColumn,
|
||||
Prompt: PromptColumn,
|
||||
AgentID: AgentIDColumn,
|
||||
|
||||
AllColumns: allColumns,
|
||||
MutableColumns: mutableColumns,
|
||||
}
|
||||
}
|
||||
16
backend/.gen/haystack/agents/table/table_use_schema.go
Normal file
16
backend/.gen/haystack/agents/table/table_use_schema.go
Normal file
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// Code generated by go-jet DO NOT EDIT.
|
||||
//
|
||||
// WARNING: Changes to this file may cause incorrect behavior
|
||||
// and will be lost if the code is regenerated
|
||||
//
|
||||
|
||||
package table
|
||||
|
||||
// UseSchema sets a new schema name for all generated table SQL builder types. It is recommended to invoke
|
||||
// this method only once at the beginning of the program.
|
||||
func UseSchema(schema string) {
|
||||
Agents = Agents.FromSchema(schema)
|
||||
SystemPrompts = SystemPrompts.FromSchema(schema)
|
||||
Tools = Tools.FromSchema(schema)
|
||||
}
|
||||
81
backend/.gen/haystack/agents/table/tools.go
Normal file
81
backend/.gen/haystack/agents/table/tools.go
Normal file
@@ -0,0 +1,81 @@
|
||||
//
|
||||
// Code generated by go-jet DO NOT EDIT.
|
||||
//
|
||||
// WARNING: Changes to this file may cause incorrect behavior
|
||||
// and will be lost if the code is regenerated
|
||||
//
|
||||
|
||||
package table
|
||||
|
||||
import (
|
||||
"github.com/go-jet/jet/v2/postgres"
|
||||
)
|
||||
|
||||
var Tools = newToolsTable("agents", "tools", "")
|
||||
|
||||
type toolsTable struct {
|
||||
postgres.Table
|
||||
|
||||
// Columns
|
||||
ID postgres.ColumnString
|
||||
Tool postgres.ColumnString
|
||||
AgentID postgres.ColumnString
|
||||
|
||||
AllColumns postgres.ColumnList
|
||||
MutableColumns postgres.ColumnList
|
||||
}
|
||||
|
||||
type ToolsTable struct {
|
||||
toolsTable
|
||||
|
||||
EXCLUDED toolsTable
|
||||
}
|
||||
|
||||
// AS creates new ToolsTable with assigned alias
|
||||
func (a ToolsTable) AS(alias string) *ToolsTable {
|
||||
return newToolsTable(a.SchemaName(), a.TableName(), alias)
|
||||
}
|
||||
|
||||
// Schema creates new ToolsTable with assigned schema name
|
||||
func (a ToolsTable) FromSchema(schemaName string) *ToolsTable {
|
||||
return newToolsTable(schemaName, a.TableName(), a.Alias())
|
||||
}
|
||||
|
||||
// WithPrefix creates new ToolsTable with assigned table prefix
|
||||
func (a ToolsTable) WithPrefix(prefix string) *ToolsTable {
|
||||
return newToolsTable(a.SchemaName(), prefix+a.TableName(), a.TableName())
|
||||
}
|
||||
|
||||
// WithSuffix creates new ToolsTable with assigned table suffix
|
||||
func (a ToolsTable) WithSuffix(suffix string) *ToolsTable {
|
||||
return newToolsTable(a.SchemaName(), a.TableName()+suffix, a.TableName())
|
||||
}
|
||||
|
||||
func newToolsTable(schemaName, tableName, alias string) *ToolsTable {
|
||||
return &ToolsTable{
|
||||
toolsTable: newToolsTableImpl(schemaName, tableName, alias),
|
||||
EXCLUDED: newToolsTableImpl("", "excluded", ""),
|
||||
}
|
||||
}
|
||||
|
||||
func newToolsTableImpl(schemaName, tableName, alias string) toolsTable {
|
||||
var (
|
||||
IDColumn = postgres.StringColumn("id")
|
||||
ToolColumn = postgres.StringColumn("tool")
|
||||
AgentIDColumn = postgres.StringColumn("agent_id")
|
||||
allColumns = postgres.ColumnList{IDColumn, ToolColumn, AgentIDColumn}
|
||||
mutableColumns = postgres.ColumnList{ToolColumn, AgentIDColumn}
|
||||
)
|
||||
|
||||
return toolsTable{
|
||||
Table: postgres.NewTable(schemaName, tableName, alias, allColumns...),
|
||||
|
||||
//Columns
|
||||
ID: IDColumn,
|
||||
Tool: ToolColumn,
|
||||
AgentID: AgentIDColumn,
|
||||
|
||||
AllColumns: allColumns,
|
||||
MutableColumns: mutableColumns,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user