- Notifications
You must be signed in to change notification settings - Fork6
A suite of tools to perform geospatial operations using Large Language Models.
License
developmentseed/llllm
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
A suite of tools to perform geospatial operations using Large Language Models.
LLLLM stands for Lat-Lng-Large-Language-Model, you can call it as "el el el el emm" or "L4M".
- Create the llllm-env -
mamba env create -f environment.yaml
- Set your OpenAI API key as an environment variable -
export OPENAI_API_KEY=<your key here>
Tools are ways the agent can use to interact with the outside world. You can find more information on how LLMs use tools to solve new tasks at scale in this paper:Toolformer
Langchain comes bundled with a set of tools like Google Search, Wikipedia, Python REPL, Shell, Wolfram Alpha & several others - find the list of pre-built toolshere
Creating a new tool is simple in Langchain. You can create a custom tool by:
- using the
Tool
dataclass or - inhering from the
BaseTool
class
Both these methods need to provide:
- name: unique & referred to by LLM while executing the chains
- description: detailed description of when & how the LLM should use this tool
- args_schema: arguments to the tool
Barebones of how to define a custom tool by inheriting from theBaseTool
class
fromlangchain.toolsimportBaseToolclassYourCustomTool(BaseTool):name=<name>description=<detailed-description>args_schema=<PydanticModel>def_run(self,query):# functionality of the toolpassdef_arun(self,query):# async implementation of the tool (Optional)raiseNotImplementedError
We have a few tools available in the LLLLM toolkit that you can use for reference -MercantileTool,GeoPyTool,OSMnxTool
Learn more about creating custom tools by reading this blog onBuilding Custom Tools for LLM Agents from Pinecone ordocumention from Langchain.
Agents act like routers using LLMs to decide which tools to use for the task at hand. There are different types of agents available in langchain:
- ReAct - Reason & Act agents are optimized for picking tools for best response - read more about them in thispaper
- Conversation Agent - they are ideal to use in a conversational setting
- Structured Tool Chat Agent - use this agent if you have tools that expect multi-input parameters. Check the OSMnx or GeoPy tool for reference.
Usage
fromagents.l4m_agentimportbase_agentagent=base_agent(llm=<LLMobject>,# instance of an LLM like GPT-3.5-TURBO or GPT-4tools=[<tool1>,<tool1>, ...],# list of tools the agent has access to perform its tasksname=<nameofagent>,# Agent.Type for eg: zero-shot-react-description or structure-chat-zero-shot-react-description (for multi-input tools))
Import the tools & create an agent in jupyter notebook to interact with them. Please find example notebookshere.
streamlit run app.py
About
A suite of tools to perform geospatial operations using Large Language Models.
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Contributors3
Uh oh!
There was an error while loading.Please reload this page.