Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A suite of tools to perform geospatial operations using Large Language Models.

License

NotificationsYou must be signed in to change notification settings

developmentseed/llllm

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".

Setup

  1. Create the llllm-env -mamba env create -f environment.yaml
  2. Set your OpenAI API key as an environment variable -export OPENAI_API_KEY=<your key here>

Getting Started

Adding a new tool

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 theTool dataclass or
  • inhering from theBaseTool 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.

Creating an agent

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))

Creating notebooks to test

Import the tools & create an agent in jupyter notebook to interact with them. Please find example notebookshere.

Running the streamlit app

streamlit run app.py

About

A suite of tools to perform geospatial operations using Large Language Models.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors3

  •  
  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp