agent learn with pipeline input ok
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
name = "JarvisPlus"
|
||||
input.module = "scan_local"
|
||||
input.params.workspace = "${myai_dir}/workspace/JarvisPlus"
|
||||
input.params.path = "${myai_dir}/data"
|
||||
parser.module = "parse_local"
|
||||
parser.params.workspace = "${myai_dir}/workspace/JarvisPlus"
|
||||
parser.params.assign_to = "JarvisPlus"
|
||||
|
||||
@@ -3,8 +3,7 @@ import aiofiles
|
||||
import chardet
|
||||
import logging
|
||||
import string
|
||||
from knowledge import ImageObjectBuilder, DocumentObjectBuilder, KnowledgePipelineEnvironment, KnowledgePipelineJournal
|
||||
from aios_kernel.storage import AIStorage
|
||||
from aios import AIStorage,ImageObjectBuilder, DocumentObjectBuilder, KnowledgePipelineEnvironment, KnowledgePipelineJournal
|
||||
|
||||
class KnowledgeDirSource:
|
||||
def __init__(self, env: KnowledgePipelineEnvironment, config):
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
# define a knowledge base class
|
||||
import json
|
||||
import string
|
||||
from aios_kernel import ComputeKernel, AIStorage
|
||||
from knowledge import *
|
||||
from aios import *
|
||||
|
||||
|
||||
class EmbeddingParser:
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
import os
|
||||
import logging
|
||||
import json
|
||||
from aios_kernel import *
|
||||
from knowledge import *
|
||||
from aios import *
|
||||
|
||||
class KnowledgeEnvironment(Environment):
|
||||
def __init__(self, env_id: str) -> None:
|
||||
super().__init__(env_id)
|
||||
class EmbeddingEnvironment(SimpleEnvironment):
|
||||
def __init__(self, workspace: str) -> None:
|
||||
super().__init__(workspace)
|
||||
self.path = os.path.join(AIStorage.get_instance().get_myai_dir(), "knowledge/indices/embedding")
|
||||
self._default_text_model = "all-MiniLM-L6-v2"
|
||||
self._default_image_model = "clip-ViT-B-32"
|
||||
@@ -93,5 +92,5 @@ class KnowledgeEnvironment(Environment):
|
||||
content = "*** I have provided the following known information for your reference with json format:\n"
|
||||
return content + self.tokens_from_objects(object_ids[index:index+1])
|
||||
|
||||
def init() -> KnowledgeEnvironment:
|
||||
return KnowledgeEnvironment("embedding")
|
||||
def init(workspace: str) -> EmbeddingEnvironment:
|
||||
return EmbeddingEnvironment(workspace)
|
||||
@@ -1,3 +1,3 @@
|
||||
pipelines = [
|
||||
"Mail/Sync"
|
||||
"JarvisPlus"
|
||||
]
|
||||
Reference in New Issue
Block a user