Skip to content

feat: Session 3 - Core Semantic Kernel Port - Basic Interfaces#4

Open
devin-ai-integration[bot] wants to merge 2 commits intogo-migrationfrom
go-migration-kernel-interfaces
Open

feat: Session 3 - Core Semantic Kernel Port - Basic Interfaces#4
devin-ai-integration[bot] wants to merge 2 commits intogo-migrationfrom
go-migration-kernel-interfaces

Conversation

@devin-ai-integration
Copy link
Copy Markdown

Description

This PR implements Session 3 of the Go migration: Core Semantic Kernel Port - Basic Interfaces. It establishes the foundational Go interfaces and types that will serve as the backbone for the agent framework, translating the Python semantic kernel concepts into idiomatic Go patterns.

⚠️ Important: This session focuses on interface definitions only. All LLM provider implementations return NotImplementedError placeholders and will be completed in future sessions.

Changes

Core Kernel Interfaces (pkg/kernel/):

  • ChatHistory and ChatMessageContent types for conversation management
  • ContentItem interface with TextContent and ImageContent implementations
  • FunctionCallContent and FunctionResultContent for tool calling
  • Kernel and KernelFunction interfaces for orchestration
  • AuthorRole enum (user, assistant, system, tool)

Agent Builder Pattern (pkg/agents/):

  • AgentBuilder with fluent configuration interface
  • SKAgent wrapper type with model metadata
  • ChatCompletionAgent interface for agent implementations
  • AgentConfig YAML configuration structure
  • basicChatAgent stub (returns "not implemented" - intentional)

Model Provider Abstraction (pkg/models/):

  • Provider interface for LLM client abstraction
  • ChatCompletionFactory for provider management
  • Stub implementations for OpenAI, Anthropic, and Google providers
  • Model capability detection (structured output support)
  • Provider-specific error types

Plugin System (pkg/plugins/):

  • Plugin and KernelFunction interfaces
  • PluginFunction implementation with parameter specs
  • ExtraDataCollector for metadata collection
  • PluginLoader interface for registration/retrieval

Error Handling (pkg/errors/):

  • Framework-specific error types with Go error wrapping
  • AuthenticationError, AgentInvokeError, PersistenceError
  • HITLInterventionRequired for human-in-the-loop flows

Documentation:

  • Updated GO_MIGRATION.md to mark Sessions 2 and 3 complete

Type of Change

  • New feature
  • Bugfix
  • Refactor
  • Documentation
  • Other

Key Review Points

Interface Design:

  • Do the Go interfaces properly capture the Python semantic kernel patterns?
  • Are the type relationships and dependencies correct?
  • Does the builder pattern provide sufficient flexibility for agent configuration?

Go Idioms:

  • Proper use of context.Context for cancellation
  • Error handling with wrapping (fmt.Errorf with %w)
  • Channel-based streaming instead of async iterables
  • Interface definitions in consumer packages

Placeholder Implementations:

  • All model providers return NotImplementedError{Feature: "X client creation"} - this is intentional
  • basicChatAgent.Invoke() and InvokeStream() return "not implemented yet" - this is intentional
  • These will be completed in Session 4 (Sequential Agent) and Session 5 (Chat Agent)

Integration Points:

  • Dependencies on existing kernel.ModelType and kernel.ChatCompletionClient from previous sessions
  • YAML configuration compatibility with existing Python format

Additional Comments

This session establishes the structural foundation for the Go migration. The interfaces are designed to support:

  • Multiple LLM providers (OpenAI, Anthropic, Google)
  • Function/tool calling with structured parameters
  • Streaming responses via Go channels
  • Human-in-the-loop approval workflows
  • Plugin-based extensibility

Next Steps: Session 4 will implement the Sequential agent execution logic using these interfaces.

Link to Devin run: https://app.devin.ai/sessions/8073faecb180437987bd162e6e9d07c3
Requested by: Jude Partovi (@jpartovi)

- Add ChatHistory and content types (TextContent, ImageContent)
- Implement function calling types and Kernel interface
- Create agent builder pattern with AgentBuilder and SKAgent
- Add model provider abstraction with OpenAI, Anthropic, Google stubs
- Implement plugin system interfaces with PluginLoader
- Define framework error types with proper Go error wrapping
- Update GO_MIGRATION.md to mark Session 3 complete

Implements foundational interfaces for agent implementations in future sessions.
Follows Go idioms with explicit errors, context.Context, and channels for streaming.

Link to Devin run: https://app.devin.ai/sessions/8073faecb180437987bd162e6e9d07c3
Requested by: Jude Partovi (@jpartovi)

Co-Authored-By: Jude Partovi <jude@partovi.org>
@devin-ai-integration
Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@jpartovi
Copy link
Copy Markdown

Devin, can you remove the updates from the README?

Per @jpartovi's request, removing documentation updates from this PR.
The PR now contains only the core interface implementations:
- pkg/kernel/ (chat_history.go, function_calling.go)
- pkg/agents/ (types.go, builder.go)
- pkg/models/ (provider.go, openai.go, anthropic.go, google.go, errors.go)
- pkg/plugins/ (plugin.go)
- pkg/errors/ (errors.go)

Documentation updates will be handled separately.

Co-Authored-By: Jude Partovi <jude@partovi.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant