Refactor runtime executor integration and introduce eino package
- Replaced the existing runtime executor with a new eino package for better modularity. - Updated Service struct to use the new RuntimeExecutor from eino. - Adjusted Run and Resume methods to accommodate changes in input types and execution logic. - Introduced new types in the eino package to align with the previous executor's functionality. - Refactored tooling preparation logic to streamline tool definitions and improve clarity. - Added new context builders and event consumers to enhance runtime event handling. - Removed legacy executor code and ensured all references are updated to the new eino package.
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
package eino
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
runtimeexecutor "cs-agent/internal/ai/runtime/executor"
|
||||
)
|
||||
|
||||
type RuntimeExecutor struct {
|
||||
inner *runtimeexecutor.Service
|
||||
}
|
||||
|
||||
func NewRuntimeExecutor() *RuntimeExecutor {
|
||||
return &RuntimeExecutor{
|
||||
inner: runtimeexecutor.NewService(),
|
||||
}
|
||||
}
|
||||
|
||||
func (s *RuntimeExecutor) ExecuteRun(ctx context.Context, req RunInput) (*RunResult, error) {
|
||||
if s == nil || s.inner == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return s.inner.ExecuteRun(ctx, runtimeexecutor.RunInput(req))
|
||||
}
|
||||
|
||||
func (s *RuntimeExecutor) ExecuteResume(ctx context.Context, req ResumeInput) (*RunResult, error) {
|
||||
if s == nil || s.inner == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return s.inner.ExecuteResume(ctx, runtimeexecutor.ResumeInput(req))
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package eino
|
||||
|
||||
import runtimeexecutor "cs-agent/internal/ai/runtime/executor"
|
||||
|
||||
type RunInput = runtimeexecutor.RunInput
|
||||
type ResumeInput = runtimeexecutor.ResumeInput
|
||||
type InterruptContextSummary = runtimeexecutor.InterruptContextSummary
|
||||
type RunResult = runtimeexecutor.RunResult
|
||||
Reference in New Issue
Block a user