Skip to content

Commit

Permalink
Convert FMP data documentation notebook to markdown format
Browse files Browse the repository at this point in the history
Switches the `.ipynb` file to a markdown-based format using delimited code blocks. Simplifies maintainability, improves readability, and aligns with standard documentation practices.
  • Loading branch information
MehdiZare committed Jan 12, 2025
1 parent 55e579c commit 40d7505
Showing 1 changed file with 85 additions and 4 deletions.
89 changes: 85 additions & 4 deletions docs/docs/integrations/tools/fmp-data.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@
"execution_count": null,
"source": [
"from langchain_fmp_data import FMPDataToolkit\n",
"query=\"Get stock market prices and technical indicators\"\n",
"\n",
"query = \"Get stock market prices and technical indicators\"\n",
"# Basic instantiation\n",
"toolkit = FMPDataToolkit(query=query)\n",
"\n",
Expand Down Expand Up @@ -216,7 +217,7 @@
"# Initialize with custom settings\n",
"advanced_tool = FMPDataTool(\n",
" max_iterations=50, # Increase max iterations for complex queries\n",
" temperature=0.2, # Adjust temperature for more/less focused responses\n",
" temperature=0.2, # Adjust temperature for more/less focused responses\n",
")\n",
"\n",
"# Example of a complex multi-part analysis\n",
Expand Down Expand Up @@ -276,7 +277,10 @@
"\n",
"\n",
"## API Reference\n",
"## FMPDataToolkit\n"
"\n",
"### FMPDataToolkit\n",
"Main class for creating collections of FMP API tools:\n",
"\n"
],
"id": "9b9dc04b8a68e94c"
},
Expand All @@ -285,8 +289,85 @@
"cell_type": "code",
"outputs": [],
"execution_count": null,
"source": "",
"source": [
"from typing import Any\n",
"from langchain.tools import Tool\n",
"\n",
"\n",
"class FMPDataToolkit:\n",
" \"\"\"Creates a collection of FMP data tools based on queries.\"\"\"\n",
"\n",
" def __init__(\n",
" self,\n",
" query: str | None = None,\n",
" num_results: int = 3,\n",
" similarity_threshold: float = 0.3,\n",
" cache_dir: str | None = None\n",
" ): ...\n",
"\n",
" def get_tools(self) -> list[Tool]:\n",
" \"\"\"Returns a list of relevant FMP API tools based on the query.\"\"\"\n",
" ..."
],
"id": "4b6604b7cf72c1a0"
},
{
"metadata": {},
"cell_type": "markdown",
"source": [
"### FMPDataTool\n",
"Unified tool that automatically selects appropriate FMP endpoints:\n"
],
"id": "7524eb1099d5e7e7"
},
{
"metadata": {},
"cell_type": "code",
"outputs": [],
"execution_count": null,
"source": [
"class FMPDataTool:\n",
" \"\"\"Single unified tool for accessing FMP data through natural language.\"\"\"\n",
"\n",
" def __init__(\n",
" self,\n",
" max_iterations: int = 3,\n",
" temperature: float = 0.0\n",
" ): ...\n",
"\n",
" def invoke(\n",
" self,\n",
" input: dict[str, Any]\n",
" ) -> str | dict[str, Any]:\n",
" \"\"\"Execute a natural language query against FMP API.\"\"\"\n",
" ..."
],
"id": "aec521045bd34060"
},
{
"metadata": {},
"cell_type": "markdown",
"source": [
"### ResponseFormat\n",
"Enum for controlling response format:\n"
],
"id": "1807550e3c40e3e8"
},
{
"metadata": {},
"cell_type": "code",
"outputs": [],
"execution_count": null,
"source": [
"from enum import Enum\n",
"\n",
"\n",
"class ResponseFormat(str, Enum):\n",
" RAW = \"raw\" # Raw API response\n",
" ANALYSIS = \"text\" # Natural language analysis\n",
" BOTH = \"both\" # Both raw data and analysis"
],
"id": "fa7c1c255f0820c2"
}
],
"metadata": {
Expand Down

0 comments on commit 40d7505

Please sign in to comment.