reme-ai 0.1.3__py3-none-any.whl → 0.1.4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- reme_ai/__init__.py +1 -1
- reme_ai/config/default.yaml +16 -0
- reme_ai/constants/common_constants.py +0 -2
- reme_ai/constants/language_constants.py +1 -1
- reme_ai/enumeration/language_enum.py +14 -0
- reme_ai/summary/task/__init__.py +0 -1
- reme_ai/summary/task/trajectory_preprocess_op.py +2 -31
- reme_ai/utils/datetime_handler.py +1 -1
- {reme_ai-0.1.3.dist-info → reme_ai-0.1.4.dist-info}/METADATA +295 -132
- {reme_ai-0.1.3.dist-info → reme_ai-0.1.4.dist-info}/RECORD +14 -16
- reme_ai/enumeration/language_constants.py +0 -215
- reme_ai/summary/task/pdf_preprocess_op_wrapper.py +0 -50
- reme_ai/utils/miner_u_pdf_processor.py +0 -726
- {reme_ai-0.1.3.dist-info → reme_ai-0.1.4.dist-info}/WHEEL +0 -0
- {reme_ai-0.1.3.dist-info → reme_ai-0.1.4.dist-info}/entry_points.txt +0 -0
- {reme_ai-0.1.3.dist-info → reme_ai-0.1.4.dist-info}/licenses/LICENSE +0 -0
- {reme_ai-0.1.3.dist-info → reme_ai-0.1.4.dist-info}/top_level.txt +0 -0
reme_ai/__init__.py
CHANGED
reme_ai/config/default.yaml
CHANGED
@@ -123,6 +123,22 @@ flow:
|
|
123
123
|
description: "user query"
|
124
124
|
required: true
|
125
125
|
|
126
|
+
op:
|
127
|
+
# retriever ops
|
128
|
+
rerank_memory_op:
|
129
|
+
backend: rerank_memory_op
|
130
|
+
llm: default
|
131
|
+
params:
|
132
|
+
enable_llm_rerank: true
|
133
|
+
enable_score_filter: false
|
134
|
+
top_k: 5
|
135
|
+
|
136
|
+
rewrite_memory_op:
|
137
|
+
backend: rewrite_memory_op
|
138
|
+
llm: default
|
139
|
+
params:
|
140
|
+
enable_llm_rewrite: true
|
141
|
+
|
126
142
|
llm:
|
127
143
|
default:
|
128
144
|
backend: openai_compatible
|
@@ -1,4 +1,4 @@
|
|
1
|
-
from
|
1
|
+
from ..enumeration.language_enum import LanguageEnum
|
2
2
|
|
3
3
|
# This dictionary maps languages to lists of words related to datetime expressions.
|
4
4
|
# It aids in recognizing and processing datetime mentions in text, enhancing the system's ability to understand
|
reme_ai/summary/task/__init__.py
CHANGED
@@ -2,7 +2,6 @@ from .comparative_extraction_op import ComparativeExtractionOp
|
|
2
2
|
from .failure_extraction_op import FailureExtractionOp
|
3
3
|
from .memory_deduplication_op import MemoryDeduplicationOp
|
4
4
|
from .memory_validation_op import MemoryValidationOp
|
5
|
-
from .pdf_preprocess_op_wrapper import PDFPreprocessOp
|
6
5
|
from .simple_comparative_summary_op import SimpleComparativeSummaryOp
|
7
6
|
from .simple_summary_op import SimpleSummaryOp
|
8
7
|
from .success_extraction_op import SuccessExtractionOp
|
@@ -1,4 +1,3 @@
|
|
1
|
-
import json
|
2
1
|
from typing import List, Dict
|
3
2
|
|
4
3
|
from flowllm import C, BaseOp
|
@@ -14,15 +13,7 @@ class TrajectoryPreprocessOp(BaseOp):
|
|
14
13
|
def execute(self):
|
15
14
|
"""Preprocess trajectories: validate and classify"""
|
16
15
|
trajectories: list = self.context.get("trajectories", [])
|
17
|
-
|
18
|
-
new_trajectories: List[Trajectory] = []
|
19
|
-
for x in trajectories:
|
20
|
-
if isinstance(x, dict):
|
21
|
-
x["messages"] = self._modify_tool_calls(x["messages"])
|
22
|
-
new_trajectories.append(Trajectory(**x))
|
23
|
-
else:
|
24
|
-
new_trajectories.append(x)
|
25
|
-
trajectories = new_trajectories
|
16
|
+
trajectories: List[Trajectory] = [Trajectory(**x) if isinstance(x, dict) else x for x in trajectories]
|
26
17
|
|
27
18
|
# Classify trajectories
|
28
19
|
classified = self._classify_trajectories(trajectories)
|
@@ -53,24 +44,4 @@ class TrajectoryPreprocessOp(BaseOp):
|
|
53
44
|
'success': success_trajectories,
|
54
45
|
'failure': failure_trajectories,
|
55
46
|
'all': trajectories
|
56
|
-
}
|
57
|
-
|
58
|
-
def _modify_tool_calls(self, messages: List[Dict]) -> List[Dict]:
|
59
|
-
new_messages = []
|
60
|
-
|
61
|
-
for msg in messages:
|
62
|
-
if 'tool_calls' in msg:
|
63
|
-
processed_tool_calls = []
|
64
|
-
for tool_call in msg['tool_calls']:
|
65
|
-
tool_type = tool_call.get("type", "function")
|
66
|
-
nested_data = tool_call.get(tool_type, {})
|
67
|
-
tool_call.update({
|
68
|
-
"arguments": json.loads(nested_data.get("arguments", "")),
|
69
|
-
"name": nested_data.get("name", "")
|
70
|
-
})
|
71
|
-
tool_call.pop(tool_type)
|
72
|
-
processed_tool_calls.append(tool_call)
|
73
|
-
msg['tool_calls'] = processed_tool_calls
|
74
|
-
new_messages.append(msg)
|
75
|
-
|
76
|
-
return new_messages
|
47
|
+
}
|
@@ -2,8 +2,8 @@ import datetime
|
|
2
2
|
import re
|
3
3
|
from typing import List
|
4
4
|
|
5
|
+
from reme_ai.constants.language_constants import LanguageEnum
|
5
6
|
from reme_ai.constants.language_constants import WEEKDAYS, DATATIME_WORD_LIST, MONTH_DICT
|
6
|
-
from reme_ai.enumeration.language_constants import LanguageEnum
|
7
7
|
|
8
8
|
|
9
9
|
class DatetimeHandler(object):
|