You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
• Implemented minor adjustments to enhance Langchain compatibility.
• Increased example quantity for improved functionality identification.
• Updated tool detection handling; "content" is now set to an empty string, as opposed to "None" due to Langchain library.
• Introduced a "groqchain" endpoint.
• Provided an additional example.
What was the closing price of Apple Inc. (AAPL) stock yesterday?
459
+
</user>
460
+
461
+
# Available Tools:
462
+
[
463
+
{
464
+
"name": "get_stock_price",
465
+
"description": "Use this function to retrieve the latest price information for a given stock symbol.\n\n:param symbol: The stock symbol to retrieve the price for (e.g., 'AAPL' for Apple Inc.).\n:return: A string containing the latest price information for the specified stock.",
466
+
"parameters": {
467
+
"type": "object",
468
+
"properties": {
469
+
"symbol": {
470
+
"type": "string"
471
+
}
472
+
}
473
+
}
474
+
},
475
+
{
476
+
"name": "get_stock_history",
477
+
"description": "Use this function to retrieve the historical price data for a given stock symbol over a specified period.\n\n:param symbol: The stock symbol to retrieve the historical data for.\n:param period: The time period for the historical data (e.g., '1d', '5d', '1mo', '1y').\n:return: A string containing the historical price data for the specified stock and period.",
478
+
"parameters": {
479
+
"type": "object",
480
+
"properties": {
481
+
"symbol": {
482
+
"type": "string"
483
+
},
484
+
"period": {
485
+
"type": "string"
486
+
}
487
+
}
488
+
}
489
+
}
490
+
]""",
491
+
"output": """<justification>
492
+
The user is asking for the closing price of Apple Inc. (AAPL) stock from the previous day. We can use the "get_stock_price" tool to retrieve the latest price information for the AAPL stock symbol. The "get_stock_history" tool is not needed in this case, as the user is only asking for the closing price from yesterday.
493
+
</justification>
494
+
495
+
<selected_tools>
496
+
{
497
+
"tool_calls": [
498
+
{
499
+
"name": "get_stock_price",
500
+
"arguments": {
501
+
"symbol": "AAPL"
502
+
}
503
+
}
504
+
]
505
+
}
506
+
</selected_tools>""",
507
+
},
508
+
{
509
+
"input": """# Conversation History:
510
+
<user>
511
+
I'm considering investing in Tesla (TSLA) stock. Can you provide me with some information to help me make a decision?
512
+
</user>
513
+
<assistant>
514
+
To help you make an informed decision about investing in Tesla (TSLA) stock, I can provide you with the following information:
515
+
516
+
1. Latest price: The current price of TSLA stock can give you an idea of its market value.
517
+
518
+
2. Historical performance: Analyzing the stock's price history over different periods (e.g., 1 month, 6 months, 1 year) can help you understand its volatility and potential for growth.
519
+
520
+
3. Company fundamentals: Researching Tesla's financial statements, revenue growth, profitability, and future projects can provide insights into the company's overall health and potential.
521
+
522
+
4. Market sentiment: Monitoring news, analyst ratings, and investor sentiment can help gauge the market's perception of Tesla stock.
523
+
524
+
Let me know which specific information you'd like me to provide first, and I'll be happy to assist you further.
525
+
</assistant>
526
+
<user>
527
+
Thanks for the overview. Let's start with the latest price and the historical performance over the past 6 months. That should give me a good starting point.
528
+
</user>
529
+
530
+
# Available Tools:
531
+
[
532
+
{
533
+
"name": "get_stock_price",
534
+
"description": "Use this function to retrieve the latest price information for a given stock symbol.\n\n:param symbol: The stock symbol to retrieve the price for (e.g., 'AAPL' for Apple Inc.).\n:return: A string containing the latest price information for the specified stock.",
535
+
"parameters": {
536
+
"type": "object",
537
+
"properties": {
538
+
"symbol": {
539
+
"type": "string"
540
+
}
541
+
}
542
+
}
543
+
},
544
+
{
545
+
"name": "get_stock_history",
546
+
"description": "Use this function to retrieve the historical price data for a given stock symbol over a specified period.\n\n:param symbol: The stock symbol to retrieve the historical data for.\n:param period: The time period for the historical data (e.g., '1d', '5d', '1mo', '1y').\n:return: A string containing the historical price data for the specified stock and period.",
547
+
"parameters": {
548
+
"type": "object",
549
+
"properties": {
550
+
"symbol": {
551
+
"type": "string"
552
+
},
553
+
"period": {
554
+
"type": "string"
555
+
}
556
+
}
557
+
}
558
+
}
559
+
]""",
560
+
"output": """<justification>
561
+
The user has requested two specific pieces of information to help them make a decision about investing in Tesla (TSLA) stock: the latest price and the historical performance over the past 6 months. To provide this information, we need to use both the "get_stock_price" and "get_stock_history" tools.
456
562
563
+
1. "get_stock_price" will be used to retrieve the current price of TSLA stock.
564
+
2. "get_stock_history" will be used to retrieve the price history of TSLA stock over the past 6 months (period: '6mo').
565
+
566
+
By combining the results from these two tools, we can give the user the requested information to support their investment decision.
567
+
</justification>
568
+
569
+
<selected_tools>
570
+
{
571
+
"tool_calls": [
572
+
{
573
+
"name": "get_stock_price",
574
+
"arguments": {
575
+
"symbol": "TSLA"
576
+
}
577
+
},
578
+
{
579
+
"name": "get_stock_history",
580
+
"arguments": {
581
+
"symbol": "TSLA",
582
+
"period": "6mo"
583
+
}
584
+
}
585
+
]
586
+
}
587
+
</selected_tools>""",
588
+
},
589
+
{
590
+
"input": """# Conversation History:
591
+
<user>
592
+
What do you think about the recent performance of the stock market?
593
+
</user>
594
+
<assistant>
595
+
The stock market's recent performance has been mixed, with some sectors showing strong growth while others have experienced volatility. Here are a few key points:
596
+
597
+
1. Tech stocks: Many technology companies have seen significant gains, driven by strong earnings and optimism about the sector's long-term prospects.
598
+
599
+
2. Energy sector: Oil and gas stocks have been under pressure due to fluctuating crude oil prices and concerns about the global economic recovery.
600
+
601
+
3. Health care: The health care sector has been a mixed bag, with some companies benefiting from the focus on COVID-19 treatments and vaccines, while others have faced challenges.
602
+
603
+
4. Overall market: The broader stock market indices, such as the S&P 500 and Dow Jones Industrial Average, have reached record highs recently, supported by positive economic data and optimism about the post-pandemic recovery.
604
+
605
+
It's important to remember that the stock market's performance is influenced by various factors, including economic indicators, geopolitical events, and investor sentiment. As an AI language model, I cannot provide personalized investment advice, but I suggest researching specific sectors and companies, and consulting with a financial advisor before making investment decisions.
606
+
</assistant>
607
+
<user>
608
+
Thanks for the insights. It's helpful to get a general overview of the market's performance across different sectors. I'll definitely do more research and consult with a financial advisor before making any investment decisions.
609
+
</user>
610
+
611
+
# Available Tools:
612
+
[
613
+
{
614
+
"name": "get_stock_price",
615
+
"description": "Use this function to retrieve the latest price information for a given stock symbol.\n\n:param symbol: The stock symbol to retrieve the price for (e.g., 'AAPL' for Apple Inc.).\n:return: A string containing the latest price information for the specified stock.",
616
+
"parameters": {
617
+
"type": "object",
618
+
"properties": {
619
+
"symbol": {
620
+
"type": "string"
621
+
}
622
+
}
623
+
}
624
+
},
625
+
{
626
+
"name": "get_stock_history",
627
+
"description": "Use this function to retrieve the historical price data for a given stock symbol over a specified period.\n\n:param symbol: The stock symbol to retrieve the historical data for.\n:param period: The time period for the historical data (e.g., '1d', '5d', '1mo', '1y').\n:return: A string containing the historical price data for the specified stock and period.",
628
+
"parameters": {
629
+
"type": "object",
630
+
"properties": {
631
+
"symbol": {
632
+
"type": "string"
633
+
},
634
+
"period": {
635
+
"type": "string"
636
+
}
637
+
}
638
+
}
639
+
}
640
+
]""",
641
+
"output": """<justification>
642
+
The user's question about the recent performance of the stock market is broad and does not require the use of the available tools. The conversation history shows that the assistant has provided a general overview of the market's performance across different sectors, which sufficiently addresses the user's question. The user also acknowledges that the insights are helpful and expresses their intention to conduct further research and consult with a financial advisor. As a result, no specific tools are needed to answer this query.
643
+
</justification>
644
+
645
+
<selected_tools>
646
+
{
647
+
"tool_calls": []
648
+
}
649
+
</selected_tools>""",
650
+
},
651
+
]
457
652
653
+
importrandom
458
654
defget_suffix():
655
+
random.shuffle(FEW_SHOTS)
459
656
# Turn each element of FEW_SHOTS into a string like '-- EXAMPLE i ---\nINPUT:\n{input}\n\nOUTPUT:\n{output}\n\n', then join them by \n\n
460
-
few_shots="\n\n".join([f'-- EXAMPLE {i} ---\nINPUT:\n{example["input"]}\n\nOUTPUT:\n{example["output"]}\n\n'fori, exampleinenumerate(FEW_SHOTS, 1)])
657
+
few_shots="\n\n".join(
658
+
[
659
+
f'-- EXAMPLE {i} ---\nINPUT:\n{example["input"]}\n\nOUTPUT:\n{example["output"]}\n\n'
0 commit comments