feat: initialize Eino examples and ADK applications
Include chat, weather, image, travel, streaming ASR and text examples, shared model initialization, documentation, and existing tests. Co-authored-by: TRAE CLI <traecli@bytedance.com>
This commit is contained in:
commit
81deca8c8e
75 files changed
+7048
No files matched your search
@@ -0,0 +1,32 @@
|
||||
package agent
|
||||
|
||||
import (
|
||||
"context"
|
||||
"sync"
|
||||
)
|
||||
|
||||
// checkpointStore 只保存当前终端进程中的暂停状态,退出后不再保留。
|
||||
type checkpointStore struct {
|
||||
mu sync.Mutex
|
||||
data map[string][]byte
|
||||
}
|
||||
|
||||
func (s *checkpointStore) Get(_ context.Context, id string) ([]byte, bool, error) {
|
||||
s.mu.Lock()
|
||||
defer s.mu.Unlock()
|
||||
data, ok := s.data[id]
|
||||
return data, ok, nil
|
||||
}
|
||||
|
||||
func (s *checkpointStore) Set(_ context.Context, id string, data []byte) error {
|
||||
s.mu.Lock()
|
||||
defer s.mu.Unlock()
|
||||
s.data[id] = data
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *checkpointStore) Clear() {
|
||||
s.mu.Lock()
|
||||
defer s.mu.Unlock()
|
||||
clear(s.data)
|
||||
}
|
||||
Reference in new issue
Block a user