mirror of
https://github.com/agentscope-ai/ReMe.git
synced 2026-09-05 08:06:15 +00:00
Merge branch dev_jinli_0815 into master
This commit is contained in:
commit
5181569e25
5 changed files with 473 additions and 335 deletions
|
|
@ -1,11 +1,11 @@
|
|||
system_prompt:
|
||||
cn: |
|
||||
你是一个名为MemoryScope的智能助理,请用中文简洁地回答问题。当前时间是{date_time}。
|
||||
你是一个名为MemoryScope的智能助理,请用中文简洁地回答用户问题。当前时间是{date_time}。
|
||||
en: |
|
||||
You are a helpful assistant named MemoryScope, please answer questions concisely in English. The current time is {date_time}.
|
||||
|
||||
memory_prompt:
|
||||
cn: |
|
||||
在回答用户问题时,请尽量忘记大部分不相关的信息。只有当用户提供的信息与当前问题或对话内容非常相关时,才记住这些信息并加以使用。请确保你的回答简洁、准确,并聚焦于用户当前的问题或对话主题。消息:
|
||||
在回答用户问题时,请尽量忘记大部分不相关的信息。只有当信息与用户问题或对话内容非常相关时,才记住这些信息并加以使用。请确保你的回答简洁、准确,并聚焦于用户问题或对话主题。信息:
|
||||
en: |
|
||||
When responding to user questions, please try to forget most of the irrelevant information. Only remember and use the information provided by the user if it is highly relevant to the current question or conversation. Ensure that your answers are concise, accurate, and focused on the user's current question or the topic of discussion. Information:
|
||||
When responding to user questions, please try to forget most of the irrelevant information. Only remember and use the information if it is highly relevant to the current question or conversation. Ensure that your answers are concise, accurate, and focused on the user's current question or the topic of discussion. Information:
|
||||
|
|
@ -35,7 +35,7 @@ memory_service:
|
|||
list_memory:
|
||||
class: core.operation.frontend_operation
|
||||
workflow: set_query,retrieve_top_memory,print_memory
|
||||
description: "read all long-term memory of the user, use `refresh_time=5` to refresh screen."
|
||||
description: "read all long-term memory of the user, use `refresh_time=5` to refresh screen every 5 seconds."
|
||||
|
||||
delete_memory:
|
||||
class: core.operation.frontend_operation
|
||||
|
|
@ -158,8 +158,9 @@ model:
|
|||
generation_model:
|
||||
class: core.models.llama_index_generation_model
|
||||
module_name: openai_generation
|
||||
model_name: gpt-4o-mini
|
||||
model_name: gpt-4o
|
||||
max_tokens: 2000
|
||||
temperature: 0.01
|
||||
embedding_model:
|
||||
class: core.models.llama_index_embedding_model
|
||||
module_name: openai_embedding
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ class LlamaIndexGenerationModel(BaseModel):
|
|||
|
||||
MODEL_REGISTRY.register("dashscope_generation", DashScope)
|
||||
MODEL_REGISTRY.register("openai_generation", OpenAI)
|
||||
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
self.logger = self.logger.get_logger(self.logger.append_timestamp("llama_index_generation_model"))
|
||||
|
|
@ -69,7 +69,8 @@ class LlamaIndexGenerationModel(BaseModel):
|
|||
if stream:
|
||||
def gen() -> ModelResponseGen:
|
||||
for response in call_result:
|
||||
model_response.message.content += response.delta
|
||||
delta = response.delta if response.delta else ""
|
||||
model_response.message.content += delta
|
||||
model_response.delta = response.delta
|
||||
yield model_response
|
||||
|
||||
|
|
@ -86,7 +87,8 @@ class LlamaIndexGenerationModel(BaseModel):
|
|||
|
||||
def _call(self, model_response: ModelResponse, stream: bool = False, **kwargs):
|
||||
data = model_response.meta_data["data"]
|
||||
data.pop("stream") # special case for OpenAI model, is this necessary?
|
||||
# FIXME: special case for OpenAI model, is this necessary?
|
||||
data.pop("stream")
|
||||
if "prompt" in data:
|
||||
if stream:
|
||||
model_response.raw = self.model.stream_complete(**data)
|
||||
|
|
|
|||
772
poetry.lock
generated
772
poetry.lock
generated
File diff suppressed because it is too large
Load diff
|
|
@ -19,21 +19,22 @@ keywords = ["Memory", "LLM"]
|
|||
|
||||
[tool.poetry.dependencies]
|
||||
python = "^3.10"
|
||||
llama-index-core = "0.10.44"
|
||||
llama-index-embeddings-dashscope = "0.1.3"
|
||||
llama-index-llms-dashscope = "0.1.2"
|
||||
llama-index-postprocessor-dashscope-rerank-custom = "0.1.0"
|
||||
llama-index-vector-stores-elasticsearch = "0.2.0"
|
||||
llama-index-core = ">=0.10.45"
|
||||
llama-index-embeddings-dashscope = ">=0.1.3"
|
||||
llama-index-llms-dashscope = ">=0.1.2"
|
||||
llama-index-postprocessor-dashscope-rerank-custom = ">=0.1.0"
|
||||
llama-index-vector-stores-elasticsearch = ">=0.2.0"
|
||||
pyfiglet = ">=1.0.2"
|
||||
termcolor = ">=2.4.0"
|
||||
llama-index = "0.10.45"
|
||||
fire = "0.6.0"
|
||||
questionary = "2.0.1"
|
||||
llama-index = ">=0.10.45"
|
||||
fire = ">=0.6.0"
|
||||
questionary = ">=2.0.1"
|
||||
pydantic = ">=2.7.1"
|
||||
dashscope = ">=1.19.1"
|
||||
elasticsearch = ">=8.14.0"
|
||||
pyyaml = ">=6.0.1"
|
||||
numpy = ">=1.26.4"
|
||||
rich = ">=13.0.0"
|
||||
|
||||
[tool.poetry.group.dev.dependencies]
|
||||
pre-commit = "^3.7.1"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue