Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs update for PR #1 on Promptless/langchain-test #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions docs/docs/how_to/tools_standard_tests.ipynb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{

Check failure on line 1 in docs/docs/how_to/tools_standard_tests.ipynb

View workflow job for this annotation

GitHub Actions / cd . / make lint #3.9

Ruff

docs/docs/how_to/tools_standard_tests.ipynb:1:1: Expected a Jupyter Notebook, which must be internally stored as JSON, but this file isn't valid JSON: expected `,` or `]` at line 109 column 5

Check failure on line 1 in docs/docs/how_to/tools_standard_tests.ipynb

View workflow job for this annotation

GitHub Actions / cd . / make lint #3.12

Ruff

docs/docs/how_to/tools_standard_tests.ipynb:1:1: Expected a Jupyter Notebook, which must be internally stored as JSON, but this file isn't valid JSON: expected `,` or `]` at line 109 column 5
"cells": [
{
"cell_type": "markdown",
Expand Down Expand Up @@ -90,6 +90,22 @@
"There are 2 namespaces in the `langchain-tests` package: \n",
"\n",
"- unit tests (`langchain_standard_tests.unit_tests`): designed to be used to test the tool in isolation and without access to external services\n",
"- integration tests (`langchain_standard_tests.integration_tests`): designed to be used to test the tool with other tools and/or external services\n",
"\n",
"### Configure pytest-socket\n",
"\n",
"To ensure your tests are robust against network dependencies, you can use the `pytest-socket` package. This package allows you to disable network calls during your tests, which is especially useful for ensuring that unit tests do not make any network requests.\n",
"\n",
"In your `pytest` configuration, you can add the following to disable network calls:\n",
"```\n",
"# pytest.ini\n",
"[pytest]\n",
"addopts = --disable-socket\n",
"```\n",
"\n",
"This configuration will prevent any network calls from being made during the tests, helping to ensure that tests are truly isolated from external services."
]
}
"- integration tests (`langchain_standard_tests.integration_tests`): designed to be used to test the tool with access to external services (in particular, the external service that the tool is designed to interact with).\n",
"\n",
":::note\n",
Expand Down
28 changes: 28 additions & 0 deletions docs/docs/integrations/providers/ollama.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,32 @@ from langchain_community.embeddings import OllamaEmbeddings

See the notebook example [here](/docs/integrations/text_embedding/ollama).

## Voice Input Support

### Voice-Enabled Applications

LangChain's Ollama models now support voice input, enabling voice-enabled applications such as virtual assistants and voice-controlled systems.

#### Speech to Text Conversion

The `SpeechToTextConverter` class allows for converting audio input to text, using the 'whisper' engine for speech recognition.

```python
from langchain_ollama.voice import SpeechToTextConverter

stt_converter = SpeechToTextConverter(engine='whisper')
text = stt_converter.convert(audio_input)
```

#### Voice Input Chain

The `VoiceInputChain` class integrates the speech-to-text component with existing language model chains, allowing for seamless audio input processing.

```python
from langchain_ollama.voice import VoiceInputChain

voice_chain = VoiceInputChain(stt_converter=stt_converter, llm_chain=ollama_chain)
output = voice_chain.run(audio_input)
```

See the notebook example [here](/docs/integrations/voice_input/ollama).
2 changes: 1 addition & 1 deletion docs/docs/versions/v0_2/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ The following features have been added during the development of 0.1.x:
- Tooling to visualize [your runnables](https://python.langchain.com/docs/expression_language/how_to/inspect/) or [your langgraph app](https://github.com/langchain-ai/langgraph/blob/main/examples/visualization.ipynb)
- Interoperability of chat message histories across most providers
- [Over 20+ partner packages in python](https://python.langchain.com/docs/integrations/providers/) for popular integrations

- Voice input support for Ollama models, enabling voice-enabled applications and expanding usability in virtual assistants, voice-controlled systems, and accessibility tools.

## What’s coming to LangChain?

Expand Down
2 changes: 2 additions & 0 deletions docs/docs/versions/v0_3/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ The following features have been added during the development of 0.2.x:
- Added the ability to [dispatch custom events](https://python.langchain.com/v0.2/docs/how_to/callbacks_custom_events/).
- Revamped integration docs and API reference. Read more [here](https://blog.langchain.dev/langchain-integration-docs-revamped/).
- Marked as deprecated a number of legacy chains and added migration guides for all of them. These are slated for removal in `langchain` 1.0.0. See the deprecated chains and associated [migration guides here](https://python.langchain.com/v0.2/docs/versions/migrating_chains/).
- Introduced voice input support for LangChain's Ollama models, enabling voice-enabled applications and expanding usability in virtual assistants, voice-controlled systems, and accessibility tools. This includes the new `SpeechToTextConverter` and `VoiceInputChain` classes.

```
## How to update your code

If you're using `langchain` / `langchain-community` / `langchain-core` 0.0 or 0.1, we recommend that you first [upgrade to 0.2](https://python.langchain.com/v0.2/docs/versions/v0_2/).
Expand Down
Loading