Metadata-Version: 2.4
Name: langchain-aisearchapi
Version: 1.0.3
Summary: LangChain integration for AI Search API (LLM, Chat, tools, and chains).
Project-URL: Homepage, https://github.com/your-org/langchain-aisearchapi
Project-URL: Issues, https://github.com/your-org/langchain-aisearchapi/issues
Author: AI Search API Team
License: MIT License
        
        Copyright (c) 2025 aisearchapi
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: ai agents,ai chatbot,ai search api,aisearchapi,automation,chat models,contextual ai,contextual search,fact checking,intelligent agents,langchain,langchain-extension,langchain-integration,langchain-tools,large language models,llm,nlp,python ai,question answering,research chain,search api,semantic search,summarization api,summary api,web search api
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Typing :: Typed
Requires-Python: >=3.9
Requires-Dist: aisearchapi-client>=0.1.0
Requires-Dist: langchain-core>=0.3.0
Requires-Dist: langchain>=0.2.14
Requires-Dist: pydantic>=2.6
Requires-Dist: requests>=2.28
Requires-Dist: typing-extensions>=4.8
Description-Content-Type: text/markdown

# 🚀 LangChain AI Search API Integration

[![PyPI version](https://img.shields.io/pypi/v/langchain-aisearchapi.svg)](https://pypi.org/project/langchain-aisearchapi/)  
[![Python Support](https://img.shields.io/badge/Python-3.8%2B-blue.svg)](https://www.python.org/)  
[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)

Official **LangChain integration** for the [AI Search API](https://aisearchapi.io).  
Use **semantic search**, **contextual answers**, **summarization**, and **intelligent agents** in your LangChain projects with just one package.

---

## ✨ Features

- 🔑 **One Package Setup** – `pip install langchain-aisearchapi` and you’re ready  
- 🤖 **LLM Interface** – Use AI Search API as a LangChain LLM  
- 💬 **Chat Model** – Build conversational agents with context memory  
- 🛠️ **Tools for Agents** – Add AI Search, Web Search API, or Summarization API into LangChain workflows  
- 📚 **Prebuilt Chains** – Research, Q&A, fact-checking, summarization out of the box  

---

## 🔑 Get Started

Create an account and get your API key:  
- [🆕 Sign Up](https://aisearchapi.io/join)  
- [🔑 Log In](https://aisearchapi.io/login)  
- [📊 Dashboard](https://aisearchapi.io/dashboard)  

---

## ⚡ Installation

Install from PyPI:

```bash
pip install langchain-aisearchapi
```

That’s it — no extra setup required.

---

## 🚀 Quick Start

### 1. Basic LLM Usage
```python
from langchain_aisearchapi import AISearchLLM

llm = AISearchLLM(api_key="your-key")
response = llm("Explain semantic search in simple terms")
print(response)
```

### 2. Conversational Chat
```python
from langchain_aisearchapi import AISearchChat
from langchain.schema import HumanMessage

chat = AISearchChat(api_key="your-key")

messages = [
    HumanMessage(content="What is LangChain?"),
    HumanMessage(content="Why do developers use it?")
]

response = chat(messages)
print(response.content)
```

### 3. AI Search + Agents
```python
from langchain_aisearchapi import AISearchTool, AISearchLLM
from langchain.agents import initialize_agent, AgentType

search_tool = AISearchTool(api_key="your-key")
llm = AISearchLLM(api_key="your-key")

agent = initialize_agent(
    tools=[search_tool],
    llm=llm,
    agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION,
    verbose=True
)

result = agent.run("Find the latest SpaceX launch details")
print(result)
```

### 4. Research Assistant
```python
from langchain_aisearchapi import create_research_chain

research = create_research_chain(api_key="your-key")
result = research.run("Breakthroughs in AI search technology 2024")
print(result)
```

### 5. Summarization API Example
```python
from langchain_aisearchapi import AISearchLLM

llm = AISearchLLM(api_key="your-key")
text = "Your long text here..."
summary = llm(f"Summarize this text: {text}")
print(summary)
```

---

## 🛠️ Components

| Component | Description | Use Case |
|-----------|-------------|----------|
| **AISearchLLM** | AI Search API as an LLM | Completions, text generation |
| **AISearchChat** | Chat model with context | Conversational AI, assistants |
| **AISearchTool** | Search / Web Search API as LangChain tool | Agents, workflows |
| **create_research_chain()** | Ready-made chain | Research and reporting |
| **Summarization API** | Summarize text into concise outputs | Notes, abstracts, executive summaries |

📘 Full API reference: [AI Search API Docs](https://docs.aisearchapi.io)

---

## ❗ Troubleshooting

- **No API key?** → [Sign up](https://aisearchapi.io/join) or [Log in](https://aisearchapi.io/login)  
- **Key issues?** → Check your [dashboard](https://aisearchapi.io/dashboard)  
- **Rate limited?** → Use retry logic with [tenacity](https://pypi.org/project/tenacity/)  

---

## 📚 Resources

- [🌐 AI Search API Homepage](https://aisearchapi.io)  
- [📘 Documentation](https://docs.aisearchapi.io)  
- [📦 PyPI Package](https://pypi.org/project/langchain-aisearchapi/)  
- [Blog](https://aisearchapi.io/blog/)

---

## 🎉 Start Now

Install the package, get your API key, and build powerful LangChain apps with the **AI Search API, Web Search API, Summary API, and Summarization API**:

```bash
pip install langchain-aisearchapi
```

👉 [Join now](https://aisearchapi.io/join) to claim your free API key and start building!

---

Made with ❤️ for the AI Search API + LangChain developer community  

---

## 🔍 SEO Keywords

LangChain AI Search API integration, AI Search API Python package, semantic search LangChain, contextual AI LangChain, AI chatbot LangChain, summarization API LangChain, web search API LangChain, AI Search API key setup, summary API integration
