langchain/libs/community/tests/unit_tests
Ishani Vyas 2b0cbd65ba
community[patch]: Add Passio Nutrition AI Food Search Tool to Community Package (#18278)
## Add Passio Nutrition AI Food Search Tool to Community Package

### Description
We propose adding a new tool to the `community` package, enabling
integration with Passio Nutrition AI for food search functionality. This
tool will provide a simple interface for retrieving nutrition facts
through the Passio Nutrition AI API, simplifying user access to
nutrition data based on food search queries.

### Implementation Details
- **Class Structure:** Implement `NutritionAI`, extending `BaseTool`. It
includes an `_run` method that accepts a query string and, optionally, a
`CallbackManagerForToolRun`.
- **API Integration:** Use `NutritionAIAPI` for the API wrapper,
encapsulating all interactions with the Passio Nutrition AI and
providing a clean API interface.
- **Error Handling:** Implement comprehensive error handling for API
request failures.

### Expected Outcome
- **User Benefits:** Enable easy querying of nutrition facts from Passio
Nutrition AI, enhancing the utility of the `langchain_community` package
for nutrition-related projects.
- **Functionality:** Provide a straightforward method for integrating
nutrition information retrieval into users' applications.

### Dependencies
- `langchain_core` for base tooling support
- `pydantic` for data validation and settings management
- Consider `requests` or another HTTP client library if not covered by
`NutritionAIAPI`.

### Tests and Documentation
- **Unit Tests:** Include tests that mock network interactions to ensure
tool reliability without external API dependency.
- **Documentation:** Create an example notebook in
`docs/docs/integrations/tools/passio_nutrition_ai.ipynb` showing usage,
setup, and example queries.

### Contribution Guidelines Compliance
- Adhere to the project's linting and formatting standards (`make
format`, `make lint`, `make test`).
- Ensure compliance with LangChain's contribution guidelines,
particularly around dependency management and package modifications.

### Additional Notes
- Aim for the tool to be a lightweight, focused addition, not
introducing significant new dependencies or complexity.
- Potential future enhancements could include caching for common queries
to improve performance.

### Twitter Handle
- Here is our Passio AI [twitter handle](https://twitter.com/@passio_ai)
where we announce our products.


If no one reviews your PR within a few days, please @-mention one of
baskaryan, efriis, eyurtsev, hwchase17.
2024-03-08 20:33:22 +00:00
..
agent_toolkits community[minor]: CogniSwitch Agent Toolkit for LangChain (#17312) 2024-02-19 10:54:13 -08:00
callbacks community[minor] : adds callback handler for Fiddler AI (#17708) 2024-02-25 18:17:03 -08:00
chat_loaders Restore self message sent before OSX 12 Monterey (#14818) 2024-01-01 16:04:14 -08:00
chat_message_histories community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 2023-12-11 13:53:30 -08:00
chat_models community[minor]: Integration for Friendli LLM and ChatFriendli ChatModel. (#17913) 2024-03-08 02:20:47 +00:00
docstore community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 2023-12-11 13:53:30 -08:00
document_loaders community[patch]: move pdf text tests to integration (#18746) 2024-03-07 10:34:22 -08:00
document_transformers community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 2023-12-11 13:53:30 -08:00
embeddings community[minor]: llamafile embeddings support (#17976) 2024-03-01 13:49:18 -08:00
examples community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 2023-12-11 13:53:30 -08:00
graphs comunity[patch]: Fix neo4j sanitizing values (#18750) 2024-03-07 19:21:52 -08:00
indexes community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 2023-12-11 13:53:30 -08:00
llms community[minor]: Integration for Friendli LLM and ChatFriendli ChatModel. (#17913) 2024-03-08 02:20:47 +00:00
retrievers community[patch]: Patch tdidf retriever (CVE-2024-2057) (#18695) 2024-03-06 15:49:04 -05:00
storage add mongodb_store (#13801) 2024-02-13 22:33:22 -05:00
tools Add dangerous parameter to requests tool (#18697) 2024-03-07 15:10:56 -05:00
utilities community[patch]: Add Passio Nutrition AI Food Search Tool to Community Package (#18278) 2024-03-08 20:33:22 +00:00
utils community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 2023-12-11 13:53:30 -08:00
vectorstores community[minor]: Add Initial Support for TiDB Vector Store (#15796) 2024-03-07 17:18:20 -08:00
__init__.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 2023-12-11 13:53:30 -08:00
conftest.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 2023-12-11 13:53:30 -08:00
test_dependencies.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 2023-12-11 13:53:30 -08:00
test_imports.py infra: Fix test filesystem paths incompatible with windows (#14388) 2023-12-21 13:45:42 -08:00
test_sql_database_schema.py infra: mv SQLDatabase tests to community (#17276) 2024-02-08 17:05:43 -08:00
test_sql_database.py community[minor]: Add lazy_table_reflection param to SqlDatabase (#18742) 2024-03-08 14:10:23 -05:00
test_sqlalchemy.py community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 2023-12-11 13:53:30 -08:00