Last active
November 24, 2024 23:38
-
-
Save dfinke/0456003ef8413695bd67be1e2b397de6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Save-JsonToExcel { | |
<# | |
.SYNOPSIS | |
Saves a JSON string to an Excel file. | |
.PARAMETER Json | |
The JSON string to save. | |
.PARAMETER Path | |
The path to save the Excel file to. | |
#> | |
param( | |
[string]$Json, | |
[string]$Path | |
) | |
$Json | ConvertFrom-Json | Export-Excel -Path $Path -AutoSize | |
Write-Output "Saved JSON to Excel file: $Path" | |
} | |
$Tools = Register-Tool Save-JsonToExcel, Export-Excel | |
$Tools += $( | |
New-StockTickerTool | |
New-TavilyAITool | |
) | |
$Instructions = @" | |
Date: $(Get-Date) | |
Path: $PSScriptRoot\Research-Summary-$((get-date).ToString("yyyyMMddhhmmss")).xlsx | |
This agent will do the research and generate a JSON summary. The JSON summary will be saved in an Excel file. | |
Only output the final file it is saved to. | |
"@ | |
$agent = New-Agent -Name 'Research Agent' -Tools $Tools -Instructions $Instructions -ShowToolCalls | |
$agent | Get-AgentResponse @" | |
What did IBM, GM, Microsoft, Google, Meta, and Exxon close at and a news item for each | |
Include stock info for each | |
Each line should be a different stock | |
Each line should have a 25 word news summary | |
"@ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.