New:Microsoft Teams Notifications Are Now Available in Socket.Learn more
Get Started

@ophirai/langchain

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ophirai/langchain

LangChain.js tool for Ophir agent negotiation — discover, negotiate, and transact with AI providers

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

@ophirai/langchain

LangChain.js tool for the Ophir agent negotiation protocol. Lets any LangChain-powered agent discover, negotiate with, and transact with AI service providers automatically.

Install

npm install @ophirai/langchain @langchain/core

Usage

import { createOphirTools } from "@ophirai/langchain";
import { ChatOpenAI } from "@langchain/openai";
import { AgentExecutor, createToolCallingAgent } from "langchain/agents";
import { ChatPromptTemplate } from "@langchain/core/prompts";

const tools = createOphirTools();

const llm = new ChatOpenAI({ model: "gpt-4" });
const prompt = ChatPromptTemplate.fromMessages([
  ["system", "You are a helpful assistant that can negotiate with AI providers."],
  ["human", "{input}"],
  ["placeholder", "{agent_scratchpad}"],
]);

const agent = createToolCallingAgent({ llm, tools, prompt });
const executor = new AgentExecutor({ agent, tools });

const result = await executor.invoke({
  input: "Find me the cheapest inference provider for llama-3-70b with p99 latency under 200ms",
});

Custom Registry

const tools = createOphirTools({ registryUrl: "https://my-registry.example.com/v1" });

Exported Tool

  • OphirNegotiateTool — A LangChain StructuredTool that negotiates with AI service providers. Accepts service category, model, budget, currency, SLA requirements, and registry URL. Returns a signed agreement with endpoint URL, pricing, and SLA terms.

API

ExportDescription
createOphirTools(config?)Returns an array of LangChain tools ready for use with any agent
OphirNegotiateToolThe tool class — use directly if you need more control
OphirNegotiateInputTypeScript type for the tool's input schema

Keywords

langchain

FAQs

Package last updated on 05 Mar 2026

Related posts