mirror of
https://github.com/mark3labs/kit.git
synced 2026-06-14 03:30:26 +00:00
Rename Fantasy* types to LLM* and remove GenerateResult alias
- FantasyMessage -> LLMMessage - FantasyUsage -> LLMUsage - FantasyResponse -> LLMResponse - Remove confusing GenerateResult = TurnResult alias - Update documentation in SKILL.md
This commit is contained in:
+4
-4
@@ -1223,16 +1223,16 @@ type TurnResult struct {
|
||||
// TotalUsage is the aggregate token usage across all steps in the turn
|
||||
// (includes tool-calling loop iterations). Nil if the provider didn't
|
||||
// report usage.
|
||||
TotalUsage *FantasyUsage
|
||||
TotalUsage *LLMUsage
|
||||
|
||||
// FinalUsage is the token usage from the last API call only. Use this
|
||||
// for context window fill estimation (InputTokens + OutputTokens ≈
|
||||
// current context size). Nil if unavailable.
|
||||
FinalUsage *FantasyUsage
|
||||
FinalUsage *LLMUsage
|
||||
|
||||
// Messages is the full updated conversation after the turn, including
|
||||
// any tool call/result messages added during the agent loop.
|
||||
Messages []FantasyMessage
|
||||
Messages []LLMMessage
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
@@ -1280,7 +1280,7 @@ type SubagentResult struct {
|
||||
// StopReason is the LLM's finish reason for the subagent's final turn.
|
||||
StopReason string
|
||||
// Usage contains token usage from the subagent's run.
|
||||
Usage *FantasyUsage
|
||||
Usage *LLMUsage
|
||||
// Elapsed is the total execution time.
|
||||
Elapsed time.Duration
|
||||
}
|
||||
|
||||
+8
-12
@@ -78,10 +78,6 @@ type MCPServerConfig = config.MCPServerConfig
|
||||
// AgentConfig holds configuration options for creating a new Agent.
|
||||
type AgentConfig = agent.AgentConfig
|
||||
|
||||
// GenerateResult contains the result and conversation history from an agent
|
||||
// interaction.
|
||||
type GenerateResult = agent.GenerateWithLoopResult
|
||||
|
||||
type (
|
||||
// ToolCallHandler is a function type for handling tool calls as they happen.
|
||||
ToolCallHandler = agent.ToolCallHandler
|
||||
@@ -130,18 +126,18 @@ type ModelsRegistry = models.ModelsRegistry
|
||||
// Ollama model loading. Signature: func(fn func() error) error.
|
||||
type SpinnerFunc = agent.SpinnerFunc
|
||||
|
||||
// ==== Fantasy Types (re-exported) ====
|
||||
// ==== LLM Types (re-exported from charm.land/fantasy) ====
|
||||
|
||||
// FantasyMessage is the underlying message type used by the fantasy agent
|
||||
// library. Re-exported so SDK users can work with fantasy types without a
|
||||
// LLMMessage is the underlying message type used by the LLM agent
|
||||
// library. Re-exported so SDK users can work with LLM types without a
|
||||
// direct import of charm.land/fantasy.
|
||||
type FantasyMessage = fantasy.Message
|
||||
type LLMMessage = fantasy.Message
|
||||
|
||||
// FantasyUsage contains token usage information from an LLM response.
|
||||
type FantasyUsage = fantasy.Usage
|
||||
// LLMUsage contains token usage information from an LLM response.
|
||||
type LLMUsage = fantasy.Usage
|
||||
|
||||
// FantasyResponse is the response type returned by the fantasy agent library.
|
||||
type FantasyResponse = fantasy.Response
|
||||
// LLMResponse is the response type returned by the LLM agent library.
|
||||
type LLMResponse = fantasy.Response
|
||||
|
||||
// ==== Compaction Types (internal/compaction/) ====
|
||||
|
||||
|
||||
@@ -119,9 +119,9 @@ result, err := host.PromptResult(ctx, "Analyze this file")
|
||||
// result.Response — assistant's text
|
||||
// result.StopReason — "stop", "length", "tool-calls", "error", etc.
|
||||
// result.SessionID — session UUID
|
||||
// result.TotalUsage — aggregate tokens across all steps (*kit.FantasyUsage)
|
||||
// result.TotalUsage — aggregate tokens across all steps (*kit.LLMUsage)
|
||||
// result.FinalUsage — tokens from last API call only
|
||||
// result.Messages — full updated conversation ([]kit.FantasyMessage)
|
||||
// result.Messages — full updated conversation ([]kit.LLMMessage)
|
||||
```
|
||||
|
||||
### Multimodal with file attachments
|
||||
@@ -525,7 +525,7 @@ result, err := host.Subagent(ctx, kit.SubagentConfig{
|
||||
},
|
||||
})
|
||||
// result.Response, result.Error, result.SessionID, result.StopReason
|
||||
// result.Usage (*kit.FantasyUsage), result.Elapsed (time.Duration)
|
||||
// result.Usage (*kit.LLMUsage), result.Elapsed (time.Duration)
|
||||
```
|
||||
|
||||
### Subscribing to subagent events from parent
|
||||
@@ -593,8 +593,8 @@ kit.Config, kit.MCPServerConfig
|
||||
// Provider types
|
||||
kit.ProviderConfig, kit.ProviderResult, kit.ModelInfo, kit.ModelCost, kit.ModelLimit
|
||||
|
||||
// Fantasy types (from charm.land/fantasy)
|
||||
kit.FantasyMessage, kit.FantasyUsage, kit.FantasyResponse
|
||||
// LLM types (from charm.land/fantasy)
|
||||
kit.LLMMessage, kit.LLMUsage, kit.LLMResponse
|
||||
|
||||
// Compaction types
|
||||
kit.CompactionResult, kit.CompactionOptions
|
||||
|
||||
Reference in New Issue
Block a user