Skip to content
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

DOC: Add tooling for Tilores entity resolution SDK #26320

Open
2 tasks done
Overbryd opened this issue Sep 11, 2024 · 4 comments · May be fixed by #29244
Open
2 tasks done

DOC: Add tooling for Tilores entity resolution SDK #26320

Overbryd opened this issue Sep 11, 2024 · 4 comments · May be fixed by #29244
Labels
🤖:docs Changes to documentation and examples, like .md, .rst, .ipynb files. Changes to the docs/ folder

Comments

@Overbryd
Copy link

URL

https://python.langchain.com/v0.2/docs/integrations/tools/

Checklist

  • I added a very descriptive title to this issue.
  • I included a link to the documentation page I am referring to (if applicable).

Issue with current documentation:

Can we get the Tilores LangChain integration listed on the LangChain WIKI?
This week we release the first version of the Python packages, and they are ready to be used.
Tilores is an entity resolution system that works with structured data and can perfectly augment GenAI in its context.
Tilores supports dynamic schemas, and can therefore be used to resolve any types of records to single entities.
Hence why we published a LangChain tool, so that structured requests can be made to any Tilores schema.

The resources we would like to link to are:

I have also added an idea/content to write on the "Tilores SDK" page for the Tilores tooling.
Happy to receive feedback on my suggestion and clarify any questions you might have.
If this is the wrong place to suggest an addition to your WIKI, please let me know.

Kind regards,

Lukas

Idea or request for content:

Tilores SDK

This tool provides the building blocks for integrating LangChain, LangGraph, and the
Tilores entity resolution system.

Developers can use these tools to create powerful systems that leverage entity resolution
for record retrieval, search, and entity resolution.

Examples

  • Human-in-the-Loop Chat: examples/chat

    This example demonstrates how to build a chat application using Chainlit and LangGraph to explore a Tilores instance through natural language. It guides users through search functionality and explains the search results.

  • Basic Usage: examples/basic

    This example shows how to use tools with an LLM model in a basic setup.

Installation

$ pip install langchain-tilores

Sources to langchain-tilores are available on Github.

Example usage

from tilores import TiloresAPI
from langchain_tilores import TiloresTools
from langchain_openai import ChatOpenAI
from langchain_core.messages import HumanMessage

# Initialize the Tilores API.
tilores = TiloresAPI.from_environ()
# TiloresTools helps you build typed tools from a specific Tilores instance, typed according to
# the schema of the instance.
tilores_tools = TiloresTools(tilores)

# Setup a LLM model for inference bound with a set of tools.
tools = [tilores_tools.search_tool]
tools_dict = {tool.name: tool for tool in tools}
model = ChatOpenAI(temperature=0, streaming=True, model_name="gpt-4o")
model = model.bind_tools(tools)

# The basic loop works like this, that a list of messages is passed to the LLM
messages = [
    HumanMessage("Find me an entity by the first name Emma, surname Schulz, born on 1988-03-12")
]
ai_message = model.invoke(messages)
messages.append(ai_message)

# And for each AiMessage, you must check if it wants to invoke tools.
for tool_call in ai_message.tool_calls:
    # Perform the tool call and append the ToolMessage to the list of messages
    selected_tool = tools_dict[tool_call['name']]
    tool_message = selected_tool.invoke(tool_call)
    messages.append(tool_message)

# Then continue the basic loop by invoking the LLM with the current state, passing the list of messages.
ai_response = model.invoke(messages)
print(ai_response.content)
@dosubot dosubot bot added the 🤖:docs Changes to documentation and examples, like .md, .rst, .ipynb files. Changes to the docs/ folder label Sep 11, 2024
@efriis
Copy link
Member

efriis commented Oct 29, 2024

hey if you're open to renaming the package tilores-langchain happy to merge in a docs page using tilores_langchain. If you want to keep the langchain-tilores name my response might take a little longer because we currently don't have a great way of distinguishing externally managed packages from ones that we co-maintain other than that.

@Overbryd
Copy link
Author

Hi @efriis, thanks for looking into this. I brought it up to the Tilores team, and they are considering the rename.
I agree that this might cause confusion if your naming convention is langchain-subproject and the convention vendor-langchain seems reasonable. The dev is currently on holidays, but will update here shortly.

@sami-yaseen-tilotech
Copy link

Hi @efriis , we have made the change the old repo langchain-tilores is now pointing to tilores-langchain with package renamed to tilores-langchain and tilores_langchain . Please let us know if any further changes are needed. Thank you for looking into this.

@efriis
Copy link
Member

efriis commented Dec 2, 2024

hey! sorry for being unclear - if you add a jupyter notebook to the monorepo in docs/docs/integrations/tools/tilores.ipynb, then it will show up in the listing at the bottom! Here's the guide: https://python.langchain.com/docs/contributing/how_to/integrations/publish/#adding-documentation-to-the-langchain-monorepo

stefan-berkner-tilotech added a commit to tilotech/langchain that referenced this issue Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖:docs Changes to documentation and examples, like .md, .rst, .ipynb files. Changes to the docs/ folder
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants