mirror of
https://github.com/agentscope-ai/ReMe.git
synced 2026-08-28 05:25:04 +00:00
format fix
This commit is contained in:
parent
a76cde5f41
commit
78dba3b911
14 changed files with 19 additions and 20 deletions
|
|
@ -14,5 +14,3 @@ class AgentWrapperMixin(BaseModel, ABC):
|
|||
|
||||
def execute(self, query: str, **kwargs) -> Trajectory:
|
||||
raise NotImplementedError
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -21,9 +21,9 @@ class BaseContextGenerator(BaseModel, ABC):
|
|||
raise NotImplementedError
|
||||
|
||||
def _generate_context_message(self,
|
||||
trajectory: Trajectory,
|
||||
nodes: List[VectorStoreNode],
|
||||
**kwargs) -> ContextMessage:
|
||||
trajectory: Trajectory,
|
||||
nodes: List[VectorStoreNode],
|
||||
**kwargs) -> ContextMessage:
|
||||
raise NotImplementedError
|
||||
|
||||
def execute(self, trajectory: Trajectory, **kwargs) -> ContextMessage:
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import json
|
||||
import re
|
||||
from typing import List, Dict, Any, Optional
|
||||
from typing import List
|
||||
|
||||
from loguru import logger
|
||||
from pydantic import Field, model_validator
|
||||
|
||||
|
|
@ -390,4 +391,4 @@ class StepContextGenerator(BaseContextGenerator):
|
|||
except json.JSONDecodeError:
|
||||
logger.warning(f"Failed to parse JSON response for key '{key}'")
|
||||
|
||||
return ""
|
||||
return ""
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
from pathlib import Path
|
||||
|
||||
import yaml
|
||||
from langchain_core.prompts import load_prompt
|
||||
from loguru import logger
|
||||
from pydantic import BaseModel, Field, model_validator
|
||||
|
||||
|
|
|
|||
|
|
@ -24,4 +24,4 @@ class BaseRunner(BaseModel):
|
|||
raise NotImplementedError
|
||||
|
||||
def summary(self, **kwargs):
|
||||
raise NotImplementedError
|
||||
raise NotImplementedError
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ summary_prompt: |
|
|||
Finally, summarize generalized experience from handling such problems to accumulate experience for future similar tasks.
|
||||
The experience should be broadly applicable, such as how to use tools effectively or approaches to solving certain types of problems.
|
||||
Also, specify the conditions or scenarios in which these experience are applicable.
|
||||
|
||||
|
||||
# Output Format
|
||||
<condition> Output the scenarios or conditions in which applying this experience would be particularly effective... </condition>
|
||||
<experience> Output generalized experience, concise content is required... </experience>
|
||||
|
|
@ -1,8 +1,9 @@
|
|||
import json
|
||||
import re
|
||||
import uuid
|
||||
import json
|
||||
from typing import List, Dict, Any, Optional, Tuple
|
||||
from datetime import datetime
|
||||
from typing import List, Dict, Any, Optional, Tuple
|
||||
|
||||
from loguru import logger
|
||||
from pydantic import Field, model_validator
|
||||
|
||||
|
|
@ -577,4 +578,4 @@ class StepSummarizer(BaseSummarizer):
|
|||
all_experiences.extend(sample.steps)
|
||||
|
||||
if all_experiences:
|
||||
self.store_experiences(all_experiences, **kwargs)
|
||||
self.store_experiences(all_experiences, **kwargs)
|
||||
|
|
|
|||
|
|
@ -159,7 +159,8 @@ class ExperienceMakerService(BaseModel):
|
|||
data["embedding_model"] = cls.init_embedding_model(data["embedding_model"])
|
||||
|
||||
if "vector_store" in data:
|
||||
data["vector_store"] = cls.init_vector_store(data["vector_store"], embedding_model=data["embedding_model"])
|
||||
data["vector_store"] = cls.init_vector_store(data["vector_store"],
|
||||
embedding_model=data["embedding_model"])
|
||||
|
||||
if "context_generator" in data:
|
||||
data["context_generator"] = cls.init_context_generator(data["context_generator"], data)
|
||||
|
|
|
|||
|
|
@ -24,5 +24,3 @@ class BaseVectorStore(BaseModel, ABC):
|
|||
|
||||
def retrieve_by_query(self, query: str, top_k: int = 3, **kwargs) -> List[VectorStoreNode]:
|
||||
raise NotImplementedError
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -140,6 +140,7 @@ Extract the original content related to the user's question directly from the co
|
|||
else:
|
||||
return result
|
||||
|
||||
|
||||
def main():
|
||||
from experiencemaker.utils.util_function import load_env_keys
|
||||
load_env_keys()
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
import asyncio
|
||||
from typing import List
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@ class HttpClient(BaseModel):
|
|||
|
||||
_client: Any = PrivateAttr()
|
||||
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
super().__init__(**kwargs)
|
||||
self._client = requests.Session() if self.keep_alive else requests
|
||||
|
|
|
|||
|
|
@ -40,4 +40,4 @@ class Registry(Generic[T]):
|
|||
return self.module_dict[module_name]
|
||||
|
||||
def __contains__(self, module_name: str):
|
||||
return module_name in self.module_dict
|
||||
return module_name in self.module_dict
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
import json
|
||||
import os
|
||||
import re
|
||||
|
||||
from loguru import logger
|
||||
|
||||
|
||||
def get_html_match_content(content: str, key: str):
|
||||
pattern = rf"<{key}>(.*?)</{key}>"
|
||||
match = re.search(pattern, content, re.DOTALL)
|
||||
|
|
@ -18,4 +20,4 @@ def load_env_keys():
|
|||
for k, v in config.items():
|
||||
os.environ[k] = v
|
||||
else:
|
||||
logger.warning(".env file not found~")
|
||||
logger.warning(".env file not found~")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue