-
Notifications
You must be signed in to change notification settings - Fork 227
chore: bump version to v1.1.0 #340
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from 1 commit
Commits
Show all changes
57 commits
Select commit
Hold shift + click to select a range
8ffdf4e
feat: delete custom_logger_handler (#289)
CarltonXiang 541191f
fix: change env model name (#292)
fridayL 99d8e19
fix:#286:https://github.com/MemTensor/MemOS/issues/286 (#293)
kakack 6b8cf85
Feat:add self defined memcube id for reg user (#295)
fridayL 709f87c
update: test branch ci
fridayL 5285829
Feat/add opentelmetry (#298)
CarltonXiang 0b0cad8
feat: add orginal context for reranking (#284)
fridayL 7b245b9
revert: nebular require_python (#300)
CarltonXiang 8f87b33
feat: chat bot api (#294)
CaralHsi c688ead
feat: chat bot api (#302)
CaralHsi 778c3b4
feat: chat bot api, add reranker filter; fix pydantic bug (#303)
CaralHsi 30cfdbf
fix: bug in internet pydantic error (#304)
CaralHsi 065a378
Feat/add opentelmetry (#307)
CarltonXiang 02b0983
feat: update nebula to nebula 5.1.1 (#311)
CaralHsi 9be4cb5
fix: nebula multi db bug (#313)
CaralHsi 05dac26
Feat/memos client (#312)
CarltonXiang 663c157
Feat: add time log for threaddict and change openai packacge singleto…
fridayL 6304368
rebase to address conflicts
tangg555 6f8963a
fix bugs: fix a bug in retriever, and add new auth info for neo4j db
tangg555 d62ff33
fix bugs & new feat: fix bugs in mem_scheduler examples, and remove i…
tangg555 945c44b
fix bugs: modify configs, examples, schedule handlers of mem_schedule…
tangg555 f930506
new feat: allow load auth config from env
tangg555 9deb368
finish the first verion code of orm, but it still has some problems w…
tangg555 e4fa4f2
new version of scheduler: 1. orm support for monitors 2. refined sear…
tangg555 44f0138
refactor: refactor the eval function of the scheduler
tangg555 cb9519d
fix bugs caused by auth config in tests
tangg555 e024fea
modify scheduler evaluation codes
tangg555 020e6c6
add the first version of scheduler test by creating temporal locomo b…
tangg555 391b422
fix bugs in temporal locomo codes in evaluation
tangg555 fcdb21c
fix bugs in text mem with neo4j backend, and set huggingface backend …
tangg555 c407987
Feat/add timerlog (#317)
fridayL f8e972d
Feat/add opentelmetry (#315)
CarltonXiang 1dc230a
feat: add api client (#316)
CarltonXiang 267a0c1
Feat: add segment lock dict (#319)
fridayL 1dc3b2e
fix:fix dump parallel for dumps cubes (#320)
fridayL beb0e07
feat: add sinlgleton (#321)
fridayL 301178d
feat: nebula&reorganize update (#322)
CaralHsi 5639a91
fix: nebula reset bug (#323)
CaralHsi 5b27384
feat: add default processing in mem-reader (#325)
CaralHsi ee89e68
feat:add time step (#326)
fridayL bb63d7a
Feat:add time step (#327)
fridayL a4de6bd
docker start (#324)
pursues 46406ea
Feat: remove json (#328)
fridayL b25f68b
feat: remove (#329)
fridayL 312223c
fix: not include embedding (#330)
CaralHsi 3646712
Feat/add time step (#331)
fridayL 8c1e4ee
Feat/add time step (#332)
fridayL 94ec427
new feat: add a rule-based baseline which uses historical evidences t…
tangg555 4fa115b
new feat: add eval and metric codes into the pipeline, and fix the bu…
tangg555 7119091
Fix/default add (#333)
CaralHsi 4a4abca
fix the bugs in rule-based baselines, and change the temporal data so…
tangg555 73c9fa1
feat: recall and searcher use parallel (#337)
lijicode 1f57a62
feat: api client (#334)
CarltonXiang a75af07
Merge branch 'dev' into test
CaralHsi f8d8c60
feat: API 1.0 (#339)
CaralHsi 62cce47
fix: format (#341)
CaralHsi 6f1159f
Merge branch 'main' into dev
CaralHsi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
feat: add orginal context for reranking (#284)
* fix: add memory * update: update orginal data * Chore: Change version to v1.0.1 * feat:fix conflict * fix: update memory get * fix: ci code * update: search_reranker * change: rerank_source for reranking * update config
- Loading branch information
commit 0b0cad858b1a93e26ba825651b08253c14356ec9
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import re | ||
|
||
from typing import Any | ||
|
||
|
||
_TAG1 = re.compile(r"^\s*\[[^\]]*\]\s*") | ||
|
||
|
||
def process_source( | ||
items: list[tuple[Any, str | dict[str, Any] | list[Any]]] | None = None, recent_num: int = 3 | ||
) -> str: | ||
""" | ||
Args: | ||
items: List of tuples where each tuple contains (memory, source). | ||
source can be str, Dict, or List. | ||
recent_num: Number of recent items to concatenate. | ||
Returns: | ||
str: Concatenated source. | ||
""" | ||
if items is None: | ||
items = [] | ||
concat_data = [] | ||
memory = None | ||
for item in items: | ||
memory, source = item | ||
for content in source: | ||
if isinstance(content, str): | ||
if "assistant:" in content: | ||
continue | ||
concat_data.append(content) | ||
if memory is not None: | ||
concat_data = [memory, *concat_data] | ||
return "\n".join(concat_data) | ||
|
||
|
||
def concat_original_source( | ||
graph_results: list, | ||
merge_field: list[str] | None = None, | ||
) -> list[str]: | ||
""" | ||
Merge memory items with original dialogue. | ||
Args: | ||
graph_results (list[TextualMemoryItem]): List of memory items with embeddings. | ||
merge_field (List[str]): List of fields to merge. | ||
Returns: | ||
list[str]: List of memory and concat orginal memory. | ||
""" | ||
if merge_field is None: | ||
merge_field = ["sources"] | ||
documents = [] | ||
for item in graph_results: | ||
memory = _TAG1.sub("", m) if isinstance((m := getattr(item, "memory", None)), str) else m | ||
sources = [] | ||
for field in merge_field: | ||
source = getattr(item.metadata, field, "") | ||
sources.append((memory, source)) | ||
concat_string = process_source(sources) | ||
documents.append(concat_string) | ||
return documents |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
adapt to 'new sourge message'