{"id":28493463,"url":"https://github.com/writer/langchain-writer","last_synced_at":"2026-04-07T05:31:47.961Z","repository":{"id":275600273,"uuid":"914486061","full_name":"writer/langchain-writer","owner":"writer","description":"Writer's official LangChain integration.","archived":false,"fork":false,"pushed_at":"2025-11-19T17:51:26.000Z","size":551,"stargazers_count":4,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-01-24T07:37:19.193Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/writer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-01-09T17:31:59.000Z","updated_at":"2025-11-18T18:48:16.000Z","dependencies_parsed_at":"2025-09-11T14:26:51.303Z","dependency_job_id":"ca2ed420-32c4-449c-9794-8a2b9c8a3354","html_url":"https://github.com/writer/langchain-writer","commit_stats":null,"previous_names":["writer/langchain-writer"],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/writer/langchain-writer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/writer%2Flangchain-writer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/writer%2Flangchain-writer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/writer%2Flangchain-writer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/writer%2Flangchain-writer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/writer","download_url":"https://codeload.github.com/writer/langchain-writer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/writer%2Flangchain-writer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31501903,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T03:10:19.677Z","status":"ssl_error","status_checked_at":"2026-04-07T03:10:13.982Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-08T09:08:56.876Z","updated_at":"2026-04-07T05:31:47.951Z","avatar_url":"https://github.com/writer.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# langchain-writer\n\nThis package contains the official LangChain integrations for Writer through their `writer-sdk`.\n\n## Installation and Setup\n\n- Install the LangChain partner package:\n\n```bash\npip install -U langchain-writer\n```\n\n- Sign up for [Writer AI Studio](https://app.writer.com/aistudio/signup?utm_campaign=devrel) and follow this [Quickstart](https://dev.writer.com/api-guides/quickstart) to obtain an API key.\n- Set your Writer API key as an environment variable (`WRITER_API_KEY`).\n\n## Chat capabilities\n\nThe `ChatWriter` class provides support of streaming and non-streaming chat completions, tool calls, batching, and asynchronous usage.\n\n### Streaming (sync/async):\n```python\nfrom langchain_writer import ChatWriter\n\nllm = ChatWriter()\n\n# Sync chat call\ngenerator = llm.stream(\"Sing a ballad of LangChain.\")\n\nfor chunk in generator:\n    print(chunk)\n\n# Async chat call\ngenerator = await llm.astream(\"Sing a ballad of LangChain.\")\n\nasync for chunk in generator:\n    print(chunk)\n```\n\n### Non-streaming (sync/async):\n\n```python\nfrom langchain_writer import ChatWriter\n\nllm = ChatWriter()\n\n# Sync chat call\nllm.invoke(\"Sing a ballad of LangChain.\")\n\n# Async chat call\nawait llm.ainvoke(\"Sing a ballad of LangChain.\")\n```\n\n### Batching (sync/async)\n\n```python\nfrom langchain_writer import ChatWriter\n\nllm = ChatWriter()\n\nllm.batch(\n        [\n            \"How to cook pancakes?\",\n            \"How to compose poem?\",\n            \"How to run faster?\",\n        ],\n        config={\"max_concurrency\": 2},\n    )\n```\n\n### Tool binding\n\n```python\nfrom langchain_writer import ChatWriter\nfrom langchain_core.tools import tool\nfrom typing import Optional\nfrom pydantic import BaseModel, Field\n\n\n@tool\ndef get_supercopa_trophies_count(club_name: str) -\u003e Optional[int]:\n    \"\"\"Returns information about supercopa trophies count.\n\n    Args:\n        club_name: Club you want to investigate info of supercopa trophies about\n\n    Returns:\n        Number of supercopa trophies or None if there is no info about requested club\n    \"\"\"\n    # Tool implementation\n\n\nclass GetWeather(BaseModel):\n    '''Get the current weather in a given location'''\n\n    location: str = Field(..., description=\"The city and state, e.g. San Francisco, CA\")\n\n\nllm = ChatWriter()\n\nllm.bind_tools([get_supercopa_trophies_count, GetWeather])\n```\n\n## Additional resources\nTo learn more about LangChain, see the [official LangChain documentation](https://python.langchain.com/docs/introduction/). To learn more about Writer, see the [Writer developer documentation](https://dev.writer.com/home/introduction).\n\n## About Writer\nWriter is the full-stack generative AI platform for enterprises. Quickly and easily build and deploy generative AI apps with a suite of developer tools fully integrated with our platform of LLMs, graph-based RAG tools, AI guardrails, and more. Learn more at [writer.com](https://www.writer.com?utm_source=github\u0026utm_medium=readme\u0026utm_campaign=devrel).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwriter%2Flangchain-writer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwriter%2Flangchain-writer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwriter%2Flangchain-writer/lists"}