package main
import (
"context"
"fmt"
"log"
"os"
"github.com/bytedance/sonic"
"github.com/hastekit/hastekit-sdk-go/pkg/agents"
"github.com/curaious/uno/pkg/agent-framework/core"
"github.com/hastekit/hastekit-sdk-go/pkg/agents/tools""
"github.com/hastekit/hastekit-sdk-go/pkg/gateway"
"github.com/hastekit/hastekit-sdk-go/pkg/gateway/llm"
"github.com/hastekit/hastekit-sdk-go/pkg/gateway/llm/responses"
"github.com/curaious/uno/pkg/sandbox/docker_sandbox"
"github.com/hastekit/hastekit-sdk-go"
)
func main() {
client, err := sdk.New(&sdk.ClientOptions{
LLMConfigs: sdk.NewInMemoryConfigStore([]*gateway.ProviderConfig{
{
ProviderName: llm.ProviderNameOpenAI,
BaseURL: "",
CustomHeaders: nil,
ApiKeys: []*gateway.APIKeyConfig{
{
Name: "Key 1",
APIKey: os.Getenv("OPENAI_API_KEY"),
},
},
},
}),
})
if err != nil {
log.Fatal(err)
}
model := client.NewLLM(sdk.LLMOptions{
Provider: llm.ProviderNameOpenAI,
Model: "gpt-4.1-mini",
})
history := client.NewConversationManager()
agent := agents.NewAgent(&agents.AgentOptions{
Name: "hello-world-agent",
Instruction: client.Prompt("You are a helpful assistant with access to terminal (bash)"),
LLM: model,
History: history,
Tools: []core.Tool{
tools.NewSandboxTool(docker_sandbox.NewManager(docker_sandbox.Config{
AgentDataPath: "/path/to/agent-data",
}), "uno-sandbox:v7"),
},
})
out, err := agent.Execute(context.Background(), &agents.AgentInput{
Messages: []responses.InputMessageUnion{
responses.UserMessage("What is the current time?"),
},
Namespace: "default",
PreviousMessageID: "",
})
if err != nil {
log.Fatal(err)
}
b, _ := sonic.Marshal(out)
fmt.Println(string(b))
}