Skip to content

Commit 1e7b280

Browse files
committed
feat: adapt builds to be standalone
1 parent aa1483a commit 1e7b280

17 files changed

+2254
-675
lines changed

.gitignore

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ node_modules
5353
# Environments
5454
env
5555
env3
56-
.env
56+
.env*
5757
.env*.local
58-
.venv
59-
env/
60-
venv/
58+
.venv*
59+
env*/
60+
venv*/
6161
ENV/
6262
env.bak/
6363
venv.bak/

examples/01_intro_to_llmstudio_base.ipynb

Lines changed: 113 additions & 87 deletions
Large diffs are not rendered by default.

examples/01_intro_to_llmstudio_core.ipynb

Lines changed: 69 additions & 69 deletions
Large diffs are not rendered by default.
File renamed without changes.

examples/01_intro_to_llmstudio_with_tracking.ipynb

Lines changed: 199 additions & 49 deletions
Large diffs are not rendered by default.

examples/03_langchain_integration.ipynb

Lines changed: 43 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
},
2727
{
2828
"cell_type": "code",
29-
"execution_count": 2,
29+
"execution_count": 4,
3030
"metadata": {},
3131
"outputs": [],
3232
"source": [
@@ -48,7 +48,7 @@
4848
},
4949
{
5050
"cell_type": "code",
51-
"execution_count": 3,
51+
"execution_count": 5,
5252
"metadata": {},
5353
"outputs": [],
5454
"source": [
@@ -81,14 +81,14 @@
8181
},
8282
{
8383
"cell_type": "code",
84-
"execution_count": 4,
84+
"execution_count": 6,
8585
"metadata": {},
8686
"outputs": [
8787
{
8888
"name": "stdout",
8989
"output_type": "stream",
9090
"text": [
91-
"[StructuredTool(name='get_departure', description='Use this to fetch the departure time of a train', args_schema=<class 'langchain_core.utils.pydantic.get_departure'>, func=<function get_departure at 0x14e4ce200>), StructuredTool(name='buy_ticket', description='Use this to buy a ticket', args_schema=<class 'langchain_core.utils.pydantic.buy_ticket'>, func=<function buy_ticket at 0x14e4cdf80>)]\n",
91+
"[StructuredTool(name='get_departure', description='Use this to fetch the departure time of a train', args_schema=<class 'langchain_core.utils.pydantic.get_departure'>, func=<function get_departure at 0x126032f20>), StructuredTool(name='buy_ticket', description='Use this to buy a ticket', args_schema=<class 'langchain_core.utils.pydantic.buy_ticket'>, func=<function buy_ticket at 0x126030720>)]\n",
9292
"\n",
9393
"\n",
9494
"\u001b[1m> Entering new AgentExecutor chain...\u001b[0m\n"
@@ -98,7 +98,7 @@
9898
"name": "stderr",
9999
"output_type": "stream",
100100
"text": [
101-
"/var/folders/f9/5mgvf90j1wn7w693rp67zms80000gn/T/ipykernel_26651/262021557.py:18: LangChainDeprecationWarning: The function `initialize_agent` was deprecated in LangChain 0.1.0 and will be removed in 1.0. Use :meth:`~Use new agent constructor methods like create_react_agent, create_json_agent, create_structured_chat_agent, etc.` instead.\n",
101+
"/var/folders/f9/5mgvf90j1wn7w693rp67zms80000gn/T/ipykernel_61814/262021557.py:18: LangChainDeprecationWarning: The function `initialize_agent` was deprecated in LangChain 0.1.0 and will be removed in 1.0. Use :meth:`~Use new agent constructor methods like create_react_agent, create_json_agent, create_structured_chat_agent, etc.` instead.\n",
102102
" agent_executor = initialize_agent(\n"
103103
]
104104
},
@@ -122,7 +122,7 @@
122122
" 'output': 'Your train departs at 12:00 AM.'}"
123123
]
124124
},
125-
"execution_count": 4,
125+
"execution_count": 6,
126126
"metadata": {},
127127
"output_type": "execute_result"
128128
}
@@ -134,14 +134,14 @@
134134
},
135135
{
136136
"cell_type": "code",
137-
"execution_count": 5,
137+
"execution_count": 7,
138138
"metadata": {},
139139
"outputs": [
140140
{
141141
"name": "stdout",
142142
"output_type": "stream",
143143
"text": [
144-
"[StructuredTool(name='get_departure', description='Use this to fetch the departure time of a train', args_schema=<class 'langchain_core.utils.pydantic.get_departure'>, func=<function get_departure at 0x14e4ce200>), StructuredTool(name='buy_ticket', description='Use this to buy a ticket', args_schema=<class 'langchain_core.utils.pydantic.buy_ticket'>, func=<function buy_ticket at 0x14e4cdf80>)]\n",
144+
"[StructuredTool(name='get_departure', description='Use this to fetch the departure time of a train', args_schema=<class 'langchain_core.utils.pydantic.get_departure'>, func=<function get_departure at 0x126032f20>), StructuredTool(name='buy_ticket', description='Use this to buy a ticket', args_schema=<class 'langchain_core.utils.pydantic.buy_ticket'>, func=<function buy_ticket at 0x126030720>)]\n",
145145
"\n",
146146
"\n",
147147
"\u001b[1m> Entering new AgentExecutor chain...\u001b[0m\n",
@@ -153,7 +153,7 @@
153153
"Invoking: `get_departure` with `{'ticket_number': '123456'}`\n",
154154
"\n",
155155
"\n",
156-
"\u001b[0m\u001b[36;1m\u001b[1;3m12:00 AM\u001b[0m\u001b[32;1m\u001b[1;3mI have bought a ticket to Madrid for you. The departure time is 12:00 AM.\u001b[0m\n",
156+
"\u001b[0m\u001b[36;1m\u001b[1;3m12:00 AM\u001b[0m\u001b[32;1m\u001b[1;3mI have bought you a ticket to Madrid with ticket number 123456. The departure time is 12:00 AM.\u001b[0m\n",
157157
"\n",
158158
"\u001b[1m> Finished chain.\u001b[0m\n"
159159
]
@@ -162,10 +162,10 @@
162162
"data": {
163163
"text/plain": [
164164
"{'input': 'Buy me a ticket to Madrid and tell the departure time',\n",
165-
" 'output': 'I have bought a ticket to Madrid for you. The departure time is 12:00 AM.'}"
165+
" 'output': 'I have bought you a ticket to Madrid with ticket number 123456. The departure time is 12:00 AM.'}"
166166
]
167167
},
168-
"execution_count": 5,
168+
"execution_count": 7,
169169
"metadata": {},
170170
"output_type": "execute_result"
171171
}
@@ -183,7 +183,7 @@
183183
},
184184
{
185185
"cell_type": "code",
186-
"execution_count": 6,
186+
"execution_count": 8,
187187
"metadata": {},
188188
"outputs": [],
189189
"source": [
@@ -223,14 +223,14 @@
223223
},
224224
{
225225
"cell_type": "code",
226-
"execution_count": 7,
226+
"execution_count": 9,
227227
"metadata": {},
228228
"outputs": [
229229
{
230230
"name": "stdout",
231231
"output_type": "stream",
232232
"text": [
233-
"[StructuredTool(name='power_disco_ball', description='Powers the spinning disco ball.', args_schema=<class 'langchain_core.utils.pydantic.power_disco_ball'>, func=<function power_disco_ball at 0x130e75a80>), StructuredTool(name='start_music', description='Play some music matching the specified parameters.', args_schema=<class 'langchain_core.utils.pydantic.start_music'>, func=<function start_music at 0x14e4ce840>), StructuredTool(name='dim_lights', description='Dim the lights.', args_schema=<class 'langchain_core.utils.pydantic.dim_lights'>, func=<function dim_lights at 0x14e995300>)]\n",
233+
"[StructuredTool(name='power_disco_ball', description='Powers the spinning disco ball.', args_schema=<class 'langchain_core.utils.pydantic.power_disco_ball'>, func=<function power_disco_ball at 0x126030680>), StructuredTool(name='start_music', description='Play some music matching the specified parameters.', args_schema=<class 'langchain_core.utils.pydantic.start_music'>, func=<function start_music at 0x1260336a0>), StructuredTool(name='dim_lights', description='Dim the lights.', args_schema=<class 'langchain_core.utils.pydantic.dim_lights'>, func=<function dim_lights at 0x126031d00>)]\n",
234234
"\n",
235235
"\n",
236236
"\u001b[1m> Entering new AgentExecutor chain...\u001b[0m\n",
@@ -249,7 +249,7 @@
249249
"\n",
250250
"\n",
251251
"\u001b[0mLights are now set to 3000%\n",
252-
"\u001b[38;5;200m\u001b[1;3mTrue\u001b[0m\u001b[32;1m\u001b[1;3mThe party is on! The disco ball is spinning, the music \"Never Gonna Give You Up\" is playing loudly and energetically, and the lights are dimmed for the perfect atmosphere. Let's celebrate! 🎉💃🕺\u001b[0m\n",
252+
"\u001b[38;5;200m\u001b[1;3mTrue\u001b[0m\u001b[32;1m\u001b[1;3mThe party is on! The disco ball is spinning, the music \"Never Gonna Give You Up\" is playing loud and energetic, and the lights are dimmed for the perfect atmosphere. Let's get this party started! 🎉💃🕺\u001b[0m\n",
253253
"\n",
254254
"\u001b[1m> Finished chain.\u001b[0m\n"
255255
]
@@ -258,10 +258,10 @@
258258
"data": {
259259
"text/plain": [
260260
"{'input': 'Turn this into a party!',\n",
261-
" 'output': 'The party is on! The disco ball is spinning, the music \"Never Gonna Give You Up\" is playing loudly and energetically, and the lights are dimmed for the perfect atmosphere. Let\\'s celebrate! 🎉💃🕺'}"
261+
" 'output': 'The party is on! The disco ball is spinning, the music \"Never Gonna Give You Up\" is playing loud and energetic, and the lights are dimmed for the perfect atmosphere. Let\\'s get this party started! 🎉💃🕺'}"
262262
]
263263
},
264-
"execution_count": 7,
264+
"execution_count": 9,
265265
"metadata": {},
266266
"output_type": "execute_result"
267267
}
@@ -276,13 +276,13 @@
276276
"source": [
277277
"### Example 3: Start a party\n",
278278
"\n",
279-
"* We'll use parallel Tool calls and `bind_tools` as functions will be depecated in v1\n",
279+
"* We'll use parallel Tool calls and `bind_tools` as functions will be depecated in Langchain v1\n",
280280
"* We'll show it work with AzureProvider for reference"
281281
]
282282
},
283283
{
284284
"cell_type": "code",
285-
"execution_count": 17,
285+
"execution_count": 11,
286286
"metadata": {},
287287
"outputs": [],
288288
"source": [
@@ -302,7 +302,7 @@
302302
},
303303
{
304304
"cell_type": "code",
305-
"execution_count": 18,
305+
"execution_count": 12,
306306
"metadata": {},
307307
"outputs": [],
308308
"source": [
@@ -328,7 +328,7 @@
328328
},
329329
{
330330
"cell_type": "code",
331-
"execution_count": 19,
331+
"execution_count": 13,
332332
"metadata": {},
333333
"outputs": [],
334334
"source": [
@@ -357,27 +357,27 @@
357357
},
358358
{
359359
"cell_type": "code",
360-
"execution_count": 20,
360+
"execution_count": 14,
361361
"metadata": {},
362362
"outputs": [
363363
{
364364
"name": "stdout",
365365
"output_type": "stream",
366366
"text": [
367-
"[StructuredTool(name='power_disco_ball', description='Powers the spinning disco ball.', args_schema=<class 'langchain_core.utils.pydantic.power_disco_ball'>, func=<function power_disco_ball at 0x14e4cc720>), StructuredTool(name='start_music', description='Play some music matching the specified parameters.', args_schema=<class 'langchain_core.utils.pydantic.start_music'>, func=<function start_music at 0x14e4cc540>), StructuredTool(name='dim_lights', description='Dim the lights. 0-100', args_schema=<class 'langchain_core.utils.pydantic.dim_lights'>, func=<function dim_lights at 0x130e771a0>)]\n",
367+
"[StructuredTool(name='power_disco_ball', description='Powers the spinning disco ball.', args_schema=<class 'langchain_core.utils.pydantic.power_disco_ball'>, func=<function power_disco_ball at 0x12422e660>), StructuredTool(name='start_music', description='Play some music matching the specified parameters.', args_schema=<class 'langchain_core.utils.pydantic.start_music'>, func=<function start_music at 0x126030680>), StructuredTool(name='dim_lights', description='Dim the lights. 0-100', args_schema=<class 'langchain_core.utils.pydantic.dim_lights'>, func=<function dim_lights at 0x1260336a0>)]\n",
368368
"Disco ball is spinning!\n",
369-
"Starting music! energetic=True loud=True, bpm=128\n",
369+
"Starting music! energetic=True loud=True, bpm=120\n",
370370
"Lights are now set to 3000%\n"
371371
]
372372
},
373373
{
374374
"data": {
375375
"text/plain": [
376376
"{'input': 'Turn this into a party!',\n",
377-
" 'output': 'The party is on! 🎉\\n\\n- The disco ball is spinning.\\n- Energetic music is playing: \"Never Gonna Give You Up.\"\\n- The lights are dimmed to a cozy 30%.\\n\\nLet the fun begin! 🕺💃'}"
377+
" 'output': 'The party is on! The disco ball is spinning, the music is pumping with \"Never Gonna Give You Up,\" and the lights are dimmed to create the perfect atmosphere. Let the fun begin! 🎉💃🕺'}"
378378
]
379379
},
380-
"execution_count": 20,
380+
"execution_count": 14,
381381
"metadata": {},
382382
"output_type": "execute_result"
383383
}
@@ -396,7 +396,7 @@
396396
},
397397
{
398398
"cell_type": "code",
399-
"execution_count": 21,
399+
"execution_count": 15,
400400
"metadata": {},
401401
"outputs": [],
402402
"source": [
@@ -412,16 +412,16 @@
412412
},
413413
{
414414
"cell_type": "code",
415-
"execution_count": 22,
415+
"execution_count": 16,
416416
"metadata": {},
417417
"outputs": [
418418
{
419419
"data": {
420420
"text/plain": [
421-
"AIMessage(content='Olá! 👋 Tudo bem com você? 😊 Como posso ajudar hoje? \\n', additional_kwargs={}, response_metadata={'token_usage': None, 'model_name': 'gemini-1.5-pro-latest', 'system_fingerprint': None, 'finish_reason': 'stop', 'logprobs': None}, id='run-a4f9ebb6-894c-4809-8095-593a88e7c622-0')"
421+
"AIMessage(content='Olá! 👋 Como posso te ajudar hoje? 😊 \\n', additional_kwargs={}, response_metadata={'token_usage': None, 'model_name': 'gemini-1.5-pro-latest', 'system_fingerprint': None, 'finish_reason': 'stop', 'logprobs': None}, id='run-7bf0a4ac-71f6-4020-9032-5e7dcc9158a2-0')"
422422
]
423423
},
424-
"execution_count": 22,
424+
"execution_count": 16,
425425
"metadata": {},
426426
"output_type": "execute_result"
427427
}
@@ -432,7 +432,7 @@
432432
},
433433
{
434434
"cell_type": "code",
435-
"execution_count": 23,
435+
"execution_count": 17,
436436
"metadata": {},
437437
"outputs": [],
438438
"source": [
@@ -459,7 +459,7 @@
459459
},
460460
{
461461
"cell_type": "code",
462-
"execution_count": 24,
462+
"execution_count": 18,
463463
"metadata": {},
464464
"outputs": [],
465465
"source": [
@@ -489,34 +489,38 @@
489489
},
490490
{
491491
"cell_type": "code",
492-
"execution_count": 25,
492+
"execution_count": 19,
493493
"metadata": {},
494494
"outputs": [
495495
{
496496
"name": "stdout",
497497
"output_type": "stream",
498498
"text": [
499-
"[StructuredTool(name='power_disco_ball', description='Powers the spinning disco ball.', args_schema=<class 'langchain_core.utils.pydantic.power_disco_ball'>, func=<function power_disco_ball at 0x14e4cd080>), StructuredTool(name='start_music', description='Play some music matching the specified parameters.', args_schema=<class 'langchain_core.utils.pydantic.start_music'>, func=<function start_music at 0x14e4cc720>), StructuredTool(name='dim_lights', description='Dim the lights. 0-100', args_schema=<class 'langchain_core.utils.pydantic.dim_lights'>, func=<function dim_lights at 0x14e4cc540>)]\n",
500-
"Disco ball is spinning!\n",
501-
"Starting music! energetic=True loud=True, bpm=120\n",
502-
"Lights are now set to 5000%\n"
499+
"[StructuredTool(name='power_disco_ball', description='Powers the spinning disco ball.', args_schema=<class 'langchain_core.utils.pydantic.power_disco_ball'>, func=<function power_disco_ball at 0x12422e2a0>), StructuredTool(name='start_music', description='Play some music matching the specified parameters.', args_schema=<class 'langchain_core.utils.pydantic.start_music'>, func=<function start_music at 0x12422e660>), StructuredTool(name='dim_lights', description='Dim the lights. 0-100', args_schema=<class 'langchain_core.utils.pydantic.dim_lights'>, func=<function dim_lights at 0x12422e020>)]\n"
503500
]
504501
},
505502
{
506503
"data": {
507504
"text/plain": [
508505
"{'input': 'Turn this into a party!',\n",
509-
" 'output': \"\\n\\nLet's get this party started! I've turned on the disco ball, started some energetic music, and dimmed the lights.\"}"
506+
" 'output': '```python\\nprint(default_api.power_disco_ball(power=True))\\nprint(default_api.start_music(bpm=120, energetic=True, loud=True))\\nprint(default_api.dim_lights(brightness=50.0))\\n```'}"
510507
]
511508
},
512-
"execution_count": 25,
509+
"execution_count": 19,
513510
"metadata": {},
514511
"output_type": "execute_result"
515512
}
516513
],
517514
"source": [
518515
"assistant_vertex(\"Turn this into a party!\")"
519516
]
517+
},
518+
{
519+
"cell_type": "code",
520+
"execution_count": null,
521+
"metadata": {},
522+
"outputs": [],
523+
"source": []
520524
}
521525
],
522526
"metadata": {

0 commit comments

Comments
 (0)