Skip to content

Resolve m types #351

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

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

Resolve m types #351

wants to merge 10 commits into from

Conversation

BoBer78
Copy link
Collaborator

@BoBer78 BoBer78 commented Jun 11, 2025

closes #338

@BoBer78 BoBer78 marked this pull request as ready for review June 13, 2025 08:37
@jankrepl
Copy link
Collaborator

jankrepl commented Jun 17, 2025

I am wondering whether we should not modify some (or all) of the entitycore-...-getall tools that have the mtype__id and provide extra description saying one needs to use this tool and basically increase the chances of the LLM spontaneously call this tool?

However, please feel free to challenge the above.

Copy link
Collaborator

@WonderPG WonderPG left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am still debating whether those resolving tools should coexist with their GET ALL counterpart in entity core. At some point having both is not the most useful imo and we should either find a way to unify them, or get rid of one. Thanks for the PR anyway !

Comment on lines +115 to +119
if m_types_response["pagination"]["total_items"] > page_size:
raise ValueError(
"Not all m-types were retreived, please increase the page size."
)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest we paginate instead of raising an error. For instance, we can remove the -p argument from the argparse, set manually a page_size and do something along the lines of:

retrieved_items = []
page = 1
while m_types_response["pagination"]["total_items"] > len(retrieved_items):
    response = await httpx_client.get(..., params={"page_size": page_size, "page": page}
    retrieved_items.extend(...)
    page += 1

Comment on lines +126 to +127
# Gather the names
pref_labels = [m_types.pref_label for m_types in m_types.mtypes]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did we ever get an answer from Daniela about what field scientists will use to search for an mtype ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really, I guess there are more important things to work on for CNS

Comment on lines +59 to +60
] = """Resolve the mtype pref label from natural english to its corresponding ID (formated ad UUID) using semantic search.
Accepts natural language inputs containing the full or partial name. If no exact match is found, returns the best scored candidates."""
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure if the LLM knows what the pref_label is. Not sure how I would say it better though.

@jankrepl
Copy link
Collaborator

We discussed this privately and we decided not to move forward with resolution tools. So @BoBer78 sorry for the extra work but I think we can just close this PR.

@BoBer78
Copy link
Collaborator Author

BoBer78 commented Jun 19, 2025

We discussed this privately and we decided not to move forward with resolution tools. So @BoBer78 sorry for the extra work but I think we can just close this PR.

Sure, let's maybe wait for a discussion with JDC to know how we proceed with the resolving. Then we close this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Resolve mtype tool should be using embeddings
3 participants