Metadata-Version: 2.4
Name: langchain-aisearchapi
Version: 1.0.5
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?utm_source=pypi).  
Bring **semantic search**, **contextual answers**, **summarization**, and **intelligent agents** to your LangChain apps in minutes.

---

## ✨ Features

- 🔑 **One-Line Install** – `pip install langchain-aisearchapi`  
- 🤖 **LLM Interface** – Use AI Search API directly as a LangChain LLM  
- 💬 **Chat Model** – Build conversations with memory & context  
- 🛠️ **Agent Tools** – Add AI Search, Web Search, Summarization APIs as tools  
- 📚 **Prebuilt Chains** – Research, Q&A, fact-checking, and summaries out of the box  

---

## 🔑 Get Started

1. [🆕 Sign Up](https://app.aisearchapi.io/join?utm_source=pypi)  
2. [🔑 Log In](https://app.aisearchapi.io/login?utm_source=pypi)  
3. [📊 Dashboard](https://app.aisearchapi.io/dashboard?utm_source=pypi) → Copy your API key  

---

## ⚡ Installation

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

---

## 🚀 Quick Examples

### LLM Usage
```python
from langchain_aisearchapi import AISearchLLM

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

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

### Tool + Agent
```python
from langchain_aisearchapi import AISearchTool, AISearchLLM
from langchain.agents import initialize_agent, AgentType

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

agent = initialize_agent(
    tools=[tool],
    llm=llm,
    agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION,
    verbose=True
)
print(agent.run("Find the latest SpaceX launch details"))
```

### Research Chain
```python
from langchain_aisearchapi import create_research_chain

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

### Summarization
```python
from langchain_aisearchapi import AISearchLLM

llm = AISearchLLM(api_key="your-key")
summary = llm("Summarize this text: AI search connects context and meaning in queries.")
print(summary)
```

---

## 🛠️ Components

| Component | Description | Use Case |
|-----------|-------------|----------|
| **AISearchLLM** | AI Search API as an LLM | Completions, text generation |
| **AISearchChat** | Chat model with context | Assistants, multi-turn chats |
| **AISearchTool** | Search / Web Search API tool | Agents, workflows |
| **create_research_chain()** | Prebuilt chain | Research & reporting |
| **Summarization API** | Text summarization | Notes, abstracts |

📘 Docs: [AI Search API Documentation](https://docs.aisearchapi.io?utm_source=pypi)

---

## ❗ Troubleshooting

- **No API key?** → [Sign up](https://app.aisearchapi.io/join?utm_source=pypi)  
- **Issues with key?** → Check [Dashboard](https://app.aisearchapi.io/dashboard?utm_source=pypi)  
- **Rate limited?** → Add retries (e.g. with [tenacity](https://pypi.org/project/tenacity/))  

---

## 📚 Resources

- [🌐 Homepage](https://aisearchapi.io?utm_source=pypi)  
- [📘 Documentation](https://docs.aisearchapi.io?utm_source=pypi)  
- [📦 PyPI](https://pypi.org/project/langchain-aisearchapi/)  
- [📝 Blog](https://aisearchapi.io/blog/)  

---

## 🎉 Get Started Now

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

👉 [Join now](https://app.aisearchapi.io/join?utm_source=pypi) for a free API key and start building!

---

Made with ❤️ for LangChain developers using the AI Search API.

---

## 🔍 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
