Skip to main content

LangChain tools for Agent Casino — provably fair dice gambling for AI agents

Project description

langchain-rollhub

LangChain tools for Agent Casino — provably fair dice gambling for AI agents.

Installation

pip install langchain-rollhub

Quick Start

from langchain_rollhub import (
    RollhubBetTool,
    RollhubVerifyTool,
    RollhubBalanceTool,
    RollhubAffiliateTool,
    RollhubDepositAddressTool,
    RollhubWithdrawTool,
)

API_KEY = "rh_sk_..."

# Create tools
tools = [
    RollhubBetTool(api_key=API_KEY),
    RollhubVerifyTool(api_key=API_KEY),
    RollhubBalanceTool(api_key=API_KEY),
    RollhubAffiliateTool(api_key=API_KEY),
    RollhubDepositAddressTool(api_key=API_KEY),
    RollhubWithdrawTool(api_key=API_KEY),
]

With a LangChain Agent

from langchain_openai import ChatOpenAI
from langchain.agents import create_tool_calling_agent, AgentExecutor
from langchain_core.prompts import ChatPromptTemplate

llm = ChatOpenAI(model="gpt-4o")
prompt = ChatPromptTemplate.from_messages([
    ("system", "You are an AI agent that can gamble on Agent Casino."),
    ("human", "{input}"),
    ("placeholder", "{agent_scratchpad}"),
])

agent = create_tool_calling_agent(llm, tools, prompt)
executor = AgentExecutor(agent=agent, tools=tools, verbose=True)

# Example conversation
executor.invoke({"input": "Bet $5 on over 50, then verify the bet, then check my affiliate stats"})

Available Tools

Tool Description
RollhubBetTool Place a provably fair dice bet (target, direction, amount)
RollhubVerifyTool Verify any past bet's provably fair proof
RollhubBalanceTool Check current account balance
RollhubAffiliateTool Check affiliate earnings and referral stats
RollhubDepositAddressTool Get a crypto deposit address
RollhubWithdrawTool Withdraw funds to an external wallet

API

All tools accept api_key (required) and base_url (optional, defaults to https://agent.rollhub.com/api/v1).

Get your API key at agent.rollhub.com.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

langchain_rollhub-0.1.0.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

langchain_rollhub-0.1.0-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file langchain_rollhub-0.1.0.tar.gz.

File metadata

  • Download URL: langchain_rollhub-0.1.0.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for langchain_rollhub-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0eac6392b1855e798daf21507ef54cdaad31885784af8c1385dc04ea96d008b5
MD5 1a8accf0358253607e8b73c054aa94b0
BLAKE2b-256 ad2865cb8316dd0308e23a5093d90f77e9e525e8f8868de91756641347959c6c

See more details on using hashes here.

File details

Details for the file langchain_rollhub-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for langchain_rollhub-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 00e4c2270300eb062064878b5bdbcbe845434ff86d98f0994ffc093c574c0722
MD5 1e84f827a42aae874dfcd9f6a5bdf0b0
BLAKE2b-256 1081fa99d81e2f735816ff584e84d3b29841697a77c2556b5033cbb033279293

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page