Metadata-Version: 2.4
Name: langchain-provider
Version: 0.2.0
Summary: Langchain based completions provider for Spyder
Author-email: Spyder Project Contributors <spyder.python@gmail.com>
License: MIT license
Project-URL: Homepage, https://github.com/spyder-ide/langchain-provider
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Education
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
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: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Text Editors :: Integrated Development Environments (IDE)
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: NOTICE.txt
Requires-Dist: langchain-core<1.3,>=1.2.14
Requires-Dist: langchain-community<1.0,>=0.4.1
Requires-Dist: openai<3.0,>=2.21.0
Requires-Dist: pydantic>=2.12.5
Requires-Dist: qtawesome
Requires-Dist: qtpy
Requires-Dist: spyder>=6.1.0
Provides-Extra: extras
Requires-Dist: pre-commit; extra == "extras"
Dynamic: license-file

# Langchain-provider

## Project Info

[![Project License](https://img.shields.io/github/license/spyder-ide/langchain-provider)](./LICENSE)
[![Join the chat at https://gitter.im/spyder-ide/public](https://badges.gitter.im/spyder-ide/spyder.svg)](https://gitter.im/spyder-ide/public)
[![OpenCollective Backers](https://opencollective.com/spyder/backers/badge.svg?color=blue)](#sponsors)
[![OpenCollective Sponsors](https://opencollective.com/spyder/sponsors/badge.svg?color=blue)](#sponsors)

---

# Overview

## Installation

To use this completions provider you will need to install Spyder 6 (at least 6.1.0)

To install the provider package from source, you can use `pip` with something like:

    pip install git+https://github.com/spyder-ide/langchain-provider.git

Or from PyPI something like:

    pip install langchain-provider

Also, you need to set the environment variable `OPENAI_API_KEY`. In case
you are actually using the OpenAI API you can get it from [here](https://platform.openai.com/signup)
but for usage with, for example, local LLMs (via things like [LMStudio](https://lmstudio.ai))
you will need to set it with a corresponding valid value.

Depending on the API you are using and options to configure available, defining the
following JSON schema for the model structured output could be useful:

```json
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "Generated schema for responses",
  "type": "object",
  "properties": {
    "suggestions": {
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "required": [
    "suggestions"
  ]
}
```

## Preview

![langchain provider demo](https://raw.githubusercontent.com/spyder-ide/langchain-provider/master/langchain-provider.gif)

## Configuration

To configure the provider number of suggestions (1 - 10), the model to use and API URL you can click on the Langchain status bar and then the `Change provider parameters` menu entry:

![langchain provider config](https://raw.githubusercontent.com/spyder-ide/langchain-provider/master/langchain-provider-config.gif)

## Dependencies

This project depends on [Spyder](https://github.com/spyder-ide/spyder).

## Changelog

Visit our [CHANGELOG](CHANGELOG.md) file to know more about our new features and improvements.

## Development and contribution

Everyone is welcome to contribute! See our [Contributing guide](CONTRIBUTING.md) for more details.

## Sponsors

Spyder is funded thanks to the generous support of

[![Quansight](https://user-images.githubusercontent.com/16781833/142477716-53152d43-99a0-470c-a70b-c04bbfa97dd4.png)](https://www.quansight.com/)[![Numfocus](https://i2.wp.com/numfocus.org/wp-content/uploads/2017/07/NumFocus_LRG.png?fit=320%2C148&ssl=1)](https://numfocus.org/)

and the donations we have received from our users around the world through [Open Collective](https://opencollective.com/spyder/):

[![Sponsors](https://opencollective.com/spyder/sponsors.svg)](https://opencollective.com/spyder#support)

## More information

[Main Website](https://www.spyder-ide.org/)

[Download Spyder (with Anaconda)](https://www.anaconda.com/download/)

[Online Documentation](https://docs.spyder-ide.org/)

[Spyder Github](https://github.com/spyder-ide/spyder)

[Troubleshooting Guide and FAQ](https://github.com/spyder-ide/spyder/wiki/Troubleshooting-Guide-and-FAQ)

[Development Wiki](https://github.com/spyder-ide/spyder/wiki/Dev:-Index)

[Gitter Chatroom](https://gitter.im/spyder-ide/public)

[Google Group](https://groups.google.com/group/spyderlib)

[@Spyder_IDE on Twitter](https://twitter.com/spyder_ide)

[@SpyderIDE on Facebook](https://www.facebook.com/SpyderIDE/)

[Support Spyder on OpenCollective](https://opencollective.com/spyder/)
