diff --git a/docs/docs/how_to/tools_standard_tests.ipynb b/docs/docs/how_to/tools_standard_tests.ipynb index 1704161935e80..92a51480845fe 100644 --- a/docs/docs/how_to/tools_standard_tests.ipynb +++ b/docs/docs/how_to/tools_standard_tests.ipynb @@ -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", diff --git a/docs/docs/integrations/providers/ollama.mdx b/docs/docs/integrations/providers/ollama.mdx index 6a05b5e2be606..5ece22bb759c9 100644 --- a/docs/docs/integrations/providers/ollama.mdx +++ b/docs/docs/integrations/providers/ollama.mdx @@ -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). \ No newline at end of file diff --git a/docs/docs/versions/v0_2/overview.mdx b/docs/docs/versions/v0_2/overview.mdx index 7fdb3fa78a740..125cf48c0fa9a 100644 --- a/docs/docs/versions/v0_2/overview.mdx +++ b/docs/docs/versions/v0_2/overview.mdx @@ -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? diff --git a/docs/docs/versions/v0_3/index.mdx b/docs/docs/versions/v0_3/index.mdx index f8cba890d7420..d0fccc9d8b526 100644 --- a/docs/docs/versions/v0_3/index.mdx +++ b/docs/docs/versions/v0_3/index.mdx @@ -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/).