Metadata-Version: 2.5
Name: langchain-shinapi
Version: 0.1.1
Summary: Search what high-authority Japanese sites say now, as a LangChain tool and retriever. By ShinAPI.
Project-URL: Homepage, https://shinapi.com
Project-URL: Documentation, https://docs.shinapi.com
License-Expression: MIT
License-File: LICENSE
Keywords: agents,japan,japanese,langchain,llm,rag,search
Requires-Python: >=3.11
Requires-Dist: langchain-core<2,>=1
Requires-Dist: shinapi>=0.1
Description-Content-Type: text/markdown

# langchain-shinapi

Search what high-authority Japanese sites say now, from LangChain: a tool for agents and a retriever for RAG. By
[ShinAPI](https://shinapi.com).

```sh
pip install langchain-shinapi
```

Get a key in the [console](https://console.shinapi.com) and set `SHINAPI_KEY`, or pass `api_key`.

## The tool

```python
from langchain.agents import create_agent
from langchain_shinapi import ShinAPISearch

agent = create_agent("anthropic:claude-sonnet-5-5", tools=[ShinAPISearch()])
agent.invoke({"messages": [{"role": "user", "content": "2026年の年収の壁はいくらですか"}]})
```

The tool answers the model with the search's JSON, and keeps the parsed answer as the message's artifact. Its
description tells the model what is indexed and what to do with each outcome: `answered`, `no_match_in_scope` or
`out_of_scope`.

## The retriever

```python
from langchain_shinapi import ShinAPIRetriever

retriever = ShinAPIRetriever(k=8, exclude_domains=["example.co.jp"])
for document in retriever.invoke("育児休業給付金の支給率"):
    print(document.metadata["url"], document.metadata["attribution"], document.page_content)
```

Each passage is a document: its text is the page content, and its URL, title, publisher, dates, licence and credit line
are the metadata. Show the attribution where you show the text.

Read the [docs](https://docs.shinapi.com).
