// application/main.go
package main
import (
"log"
"net/http"
"os"
"github.com/curaious/uno/pkg/gateway"
"github.com/curaious/uno/pkg/llm"
"github.com/curaious/uno/pkg/sdk"
)
func main() {
client, err := sdk.New(&sdk.ClientOptions{
LLMConfigs: sdk.NewInMemoryConfigStore([]*gateway.ProviderConfig{
{
ProviderName: llm.ProviderNameOpenAI,
ApiKeys: []*gateway.APIKeyConfig{
{
Name: "Key 1",
APIKey: os.Getenv("OPENAI_API_KEY"),
},
},
},
}),
TemporalConfig: sdk.TemporalConfig{
Endpoint: "0.0.0.0:7233",
},
RedisConfig: sdk.RedisConfig{
Endpoint: "localhost:6379",
},
})
if err != nil {
log.Fatal(err)
}
model := client.NewLLM(sdk.LLMOptions{
Provider: llm.ProviderNameOpenAI,
Model: "gpt-4o-mini",
})
// Register the agent
agentName := "my-agent"
_ = client.NewTemporalAgent(&sdk.AgentOptions{
Name: agentName,
Instruction: client.Prompt("You are a helpful assistant."),
LLM: model,
History: client.NewConversationManager(),
})
// Start application server (no Temporal worker here)
log.Println("Application server starting on :8070")
http.ListenAndServe(":8070", client)
}