Skip to content

Commit 2282762

Browse files
joeconstantinoJoe Constantino
andauthored
docs: small Tableau docs update (#30827)
Description: small Tableau docs update Issue: adds required environment variable Dependencies: tableau-langchain --------- Co-authored-by: Joe Constantino <[email protected]>
1 parent f7c4965 commit 2282762

File tree

1 file changed

+14
-46
lines changed

1 file changed

+14
-46
lines changed

docs/docs/integrations/tools/tableau.ipynb

Lines changed: 14 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
},
9999
{
100100
"cell_type": "code",
101-
"execution_count": null,
101+
"execution_count": 1,
102102
"id": "310d21b3",
103103
"metadata": {},
104104
"outputs": [],
@@ -125,7 +125,7 @@
125125
},
126126
{
127127
"cell_type": "code",
128-
"execution_count": 6,
128+
"execution_count": null,
129129
"id": "ccfb4159-34ac-4816-a8f0-795c5442c0b2",
130130
"metadata": {},
131131
"outputs": [],
@@ -148,16 +148,16 @@
148148
" \"TABLEAU_JWT_SECRET\"\n",
149149
") # a JWT secret ID (obtained through Tableau's admin UI)\n",
150150
"tableau_api_version = \"3.21\" # the current Tableau REST API Version\n",
151-
"tableau_user = \"[email protected]\" # replace with the username querying the target Tableau Data Source\n",
151+
"tableau_user = \"[email protected]\" # enter the username querying the target Tableau Data Source\n",
152152
"\n",
153153
"# For this cookbook we are connecting to the Superstore dataset that comes by default with every Tableau server\n",
154154
"datasource_luid = (\n",
155155
" \"0965e61b-a072-43cf-994c-8c6cf526940d\" # the target data source for this Tool\n",
156156
")\n",
157-
"\n",
157+
"model_provider = \"openai\" # the name of the model provider you are using for your Agent\n",
158158
"# Add variables to control LLM models for the Agent and Tools\n",
159159
"os.environ[\"OPENAI_API_KEY\"] # set an your model API key as an environment variable\n",
160-
"tooling_llm_model = \"gpt-4o\""
160+
"tooling_llm_model = \"gpt-4o-mini\""
161161
]
162162
},
163163
{
@@ -178,7 +178,7 @@
178178
},
179179
{
180180
"cell_type": "code",
181-
"execution_count": null,
181+
"execution_count": 6,
182182
"id": "72ee3eca",
183183
"metadata": {},
184184
"outputs": [],
@@ -194,6 +194,7 @@
194194
" tableau_user=tableau_user,\n",
195195
" datasource_luid=datasource_luid,\n",
196196
" tooling_llm_model=tooling_llm_model,\n",
197+
" model_provider=model_provider,\n",
197198
")\n",
198199
"\n",
199200
"# load the List of Tools to be used by the Agent. In this case we will just load our data source Q&A tool.\n",
@@ -211,47 +212,14 @@
211212
},
212213
{
213214
"cell_type": "code",
214-
"execution_count": 8,
215+
"execution_count": null,
215216
"id": "06a1d3f7-79a8-452e-b37e-9070d15445b0",
216217
"metadata": {},
217-
"outputs": [
218-
{
219-
"data": {
220-
"text/markdown": [
221-
"Here are the results for the states with the highest sales and profits based on the data queried:\n",
222-
"\n",
223-
"### States with the Most Sales\n",
224-
"1. **California**: $457,687.63\n",
225-
"2. **New York**: $310,876.27\n",
226-
"3. **Texas**: $170,188.05\n",
227-
"4. **Washington**: $138,641.27\n",
228-
"5. **Pennsylvania**: $116,511.91\n",
229-
"\n",
230-
"### States with the Most Profit\n",
231-
"1. **California**: $76,381.39\n",
232-
"2. **New York**: $74,038.55\n",
233-
"3. **Washington**: $33,402.65\n",
234-
"4. **Michigan**: $24,463.19\n",
235-
"5. **Virginia**: $18,597.95\n",
236-
"\n",
237-
"### Comparison\n",
238-
"- **California** and **New York** are the only states that appear in both lists, indicating they are the top sellers and also generate the most profit.\n",
239-
"- **Texas**, while having the third highest sales, does not rank in the top five for profit, showing a potential issue with profitability despite high sales.\n",
240-
"\n",
241-
"This analysis suggests that high sales do not always correlate with high profits, as seen with Texas."
242-
],
243-
"text/plain": [
244-
"<IPython.core.display.Markdown object>"
245-
]
246-
},
247-
"metadata": {},
248-
"output_type": "display_data"
249-
}
250-
],
218+
"outputs": [],
251219
"source": [
252220
"from IPython.display import Markdown, display\n",
253221
"\n",
254-
"model = ChatOpenAI(model=\"gpt-4o-mini\", temperature=0)\n",
222+
"model = ChatOpenAI(model=\"gpt-4o\", temperature=0)\n",
255223
"\n",
256224
"tableauAgent = create_react_agent(model, tools)\n",
257225
"\n",
@@ -261,13 +229,13 @@
261229
" \"messages\": [\n",
262230
" (\n",
263231
" \"human\",\n",
264-
" \"which states sell the most? Are those the same states with the most profits?\",\n",
232+
" \"what's going on with table sales?\",\n",
265233
" )\n",
266234
" ]\n",
267235
" }\n",
268236
")\n",
269237
"messages\n",
270-
"# display(Markdown(messages['messages'][4].content)) #display a nicely formatted answer for successful generations"
238+
"# display(Markdown(messages['messages'][3].content)) #display a nicely formatted answer for successful generations"
271239
]
272240
},
273241
{
@@ -293,9 +261,9 @@
293261
],
294262
"metadata": {
295263
"kernelspec": {
296-
"display_name": "Python (package_test_env)",
264+
"display_name": "Python 3",
297265
"language": "python",
298-
"name": "package_test_env"
266+
"name": "python3"
299267
},
300268
"language_info": {
301269
"codemirror_mode": {

0 commit comments

Comments
 (0)