Update LLM integration and add new agent tools and utilities
Refactored LLM handling to use updated langchaingo models and tools, replacing gollm dependencies. Introduced agent-related utilities, tools, and counters for better modular functionality. Added a parser for LLM model configuration and revamped the answering mechanism with enhanced support for tool-based interaction.
This commit is contained in:
34
pkg/agent/test/main.go
Normal file
34
pkg/agent/test/main.go
Normal file
@@ -0,0 +1,34 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
|
||||
"github.com/tmc/langchaingo/llms"
|
||||
)
|
||||
|
||||
func testFunction(args struct{ a, b int }) {
|
||||
// This is a test function
|
||||
}
|
||||
|
||||
func main() {
|
||||
v := reflect.New(reflect.TypeOf(testFunction))
|
||||
|
||||
t := reflect.TypeOf(testFunction)
|
||||
|
||||
for i := 0; i < t.NumIn(); i++ {
|
||||
param := t.In(i)
|
||||
|
||||
llms.MessageContent{
|
||||
Role: llms.ChatMessageTypeTool,
|
||||
Parts: []llms.ContentPart{
|
||||
llms.ToolCallResponse{
|
||||
Name: "testFunction",
|
||||
},
|
||||
},
|
||||
}
|
||||
if param.Type().Kind() == reflect.Struct {
|
||||
|
||||
}
|
||||
println(param.Name(), param.Kind().String())
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user