feat: refactor runtime to use application runtime executor and update related types
This commit is contained in:
@@ -2,30 +2,30 @@ package eino
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
runtimeexecutor "cs-agent/internal/ai/runtime/executor"
|
||||
"cs-agent/internal/ai/runtime/executor"
|
||||
)
|
||||
|
||||
// TODO 这个不要了,直接使用executor不行吗?
|
||||
type RuntimeExecutor struct {
|
||||
inner *runtimeexecutor.Service
|
||||
inner *executor.Service
|
||||
}
|
||||
|
||||
func NewRuntimeExecutor() *RuntimeExecutor {
|
||||
return &RuntimeExecutor{
|
||||
inner: runtimeexecutor.NewService(),
|
||||
inner: executor.NewService(),
|
||||
}
|
||||
}
|
||||
|
||||
func (s *RuntimeExecutor) ExecuteRun(ctx context.Context, req RunInput) (*RunResult, error) {
|
||||
func (s *RuntimeExecutor) ExecuteRun(ctx context.Context, req executor.RunInput) (*executor.RunResult, error) {
|
||||
if s == nil || s.inner == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return s.inner.ExecuteRun(ctx, runtimeexecutor.RunInput(req))
|
||||
return s.inner.ExecuteRun(ctx, executor.RunInput(req))
|
||||
}
|
||||
|
||||
func (s *RuntimeExecutor) ExecuteResume(ctx context.Context, req ResumeInput) (*RunResult, error) {
|
||||
func (s *RuntimeExecutor) ExecuteResume(ctx context.Context, req executor.ResumeInput) (*executor.RunResult, error) {
|
||||
if s == nil || s.inner == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return s.inner.ExecuteResume(ctx, runtimeexecutor.ResumeInput(req))
|
||||
return s.inner.ExecuteResume(ctx, executor.ResumeInput(req))
|
||||
}
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
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