Giter VIP home page Giter VIP logo

langchainbitcoin's People

Contributors

hannahmr avatar roasbeef avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

langchainbitcoin's Issues

feature: use tools schema to provide more context for complex function calls

Today we create a series of wrappers around the base set of lnd gRPC API endpoints. This works well for simple calls like addinvoice that have simple inputs, but for other calls, we want to be able to give more context to the agent in form of a better input schema.

Some examples of this are here: https://python.langchain.com/docs/modules/agents/tools/how_to/tool_input_validation

As an example, consider the new_address tool. The input is actually an enum of the address type with the following values: WITNESS_PUBKEY_HASH, TAPROOT_PUBKEY, etc, etc. We can define a more structred input that looks something like:

class AddrTypes(Enum):
    TAPROOT_PUBKEY = 0
    WITNESS_PUBKEY_HASH = 1

class NewAddrSchema(BaseModel):
     addr_type: AddrTypes = Field("the type of address to create")

Then each time we use the @tool decorator, we also pass the schema for the input like @tool(args_schema=NewAddrSchema).

For other calls that need more arguments, like finding a route on LN to a dest, then we can use a similar pattern to be able to profile few-shot examples for each of the fields, and also validate them.

text-davinci-003 deprecated error

Running LangChainBitcoin now returns the below error...

“openai.error.InvalidRequestError: The model text-davinci-003 has been deprecated”

It seems that the version of LangChain being used needs to be updated. I was able to update the version of LangChain being used from 0.0.205 to 0.1.13. That change also required changes to several other dependencies.

Updated: langchain 0.0.205 → 0.1.13
Updated: openai 0.27.6 → 1.10.0,<2.0.0
Updated: packaging 23.1 → 23.2,<24.0
Updated: typing_extensions 4.5.0 → 4.7,<5
Changes: platformdirs 3.6.0 → 2.6.2
Added: langchain-openai 0.1.1

With these changes the requirements can be installed without error, and the program can be run without receiving the text-davinci-003 deprecated error, however, some of the context for the prompts has been lost.

The API documentation in API_DOCS is being understood, but the prompt given via chain_new.run() is not. It seems that chain_new.run should be updated to chain_new.invoke, but that there will be other changes needed as well.

I suspect that what is being imported in the l402_api_chain.py file will need to be updated as well, but I haven’t found the solution just yet.

enhancement: fill in additional Bitcoin/LN tools

As is, we can easily integrate any of the APIs that are exported by lnd defined here: https://lightning.engineering/api-docs/api/lnd/index.html.

This includes normal LN node operation, but also introspecting into the channel graph, and also fetching and parsing blocks.

Here're some additional tools we should start to expose:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.