microsoft / genaiscript

Automatable GenAI Scripting
https://microsoft.github.io/genaiscript/
MIT License
163 stars 30 forks source link

Error message returned using web search is uninformative #332

Closed bzorn closed 4 months ago

bzorn commented 5 months ago

Type: Documentation

The search failed and the error message should say something about my not having the proper API key.

Describe the issue

Code in the script:

const parkinfo = await retrieval.webSearch("mt rainier things to do")
def("PARKINFO", parkinfo.webPages[0])

To Reproduce

Create a script with no other inputs and run it.

Expected behavior

Expected it to retrieve web pages, instead error message: 💾 script 🧬 prompt 📓 script source model: gpt-4 temperature: 0.2 max tokens: 4000 🌐 retrieval web search mt rainier things to do ❌ web search error {}

Environment

vscode: 1.87.2 extension: 1.19.1

Request

## plan-weekend

<details id="🤖-automation" class="genaiscript">
<summary>
🤖 automation
</summary>

This operation can be automated using the command line interface.

- to run on all files at once, use the `run` command:

```bash
npx --yes genaiscript@^1.19.1 run plan-weekend "genaisrc/plan-weekend.genai.js" --apply-edits
npx --yes genaiscript@^1.19.1 batch plan-weekend "genaisrc/plan-weekend.genai.js" --apply-edits

📄 spec ```markdown # Specification ```
💾 script
🧬 prompt
📓 script source ```js script({ title: "plan-weekend", description: "Given details about my goals, help plan my weekend", group: "recreational", model: "gpt-4", maxTokens: 4000, }) const parkinfo = await retrieval.webSearch("mt rainier things to do") def("PARKINFO", parkinfo.webPages[0]) const weather = await retrieval.webSearch("mt rainier weather") def("WEATHER", weather.webPages) const outputName = path.join(path.dirname(env.spec.filename), "trip-plan.md") // use $ to output formatted text to the prompt $`You are a helpful assistant that is an expert in planning weekend trips. I've included information about my destination in PARKINFO and WEATHER. Help me plan a weekend trip starting tomorrow. Write the result to a markdown file at ${outputName}. ` ```
- model: gpt-4 - temperature: 0.2 - max tokens: 4000
🌐 retrieval web search `mt rainier things to do` ### ❌ web search error ```yaml {} ```
### ❌ at prompt line 11, column 26 ```yaml {} ```

Extension version: 1.19.1
VS Code version: Code 1.87.2 (863d2581ecda6849923a2118d93a088b0745d9d6, 2024-03-08T15:20:17.278Z)
OS version: Windows_NT x64 10.0.22631
Modes:

<details>
<summary>System Info</summary>

|Item|Value|
|---|---|
|CPUs|Intel(R) Xeon(R) Silver 4108 CPU @ 1.80GHz (32 x 1796)|
|GPU Status|2d_canvas: enabled<br>canvas_oop_rasterization: enabled_on<br>direct_rendering_display_compositor: disabled_off_ok<br>gpu_compositing: enabled<br>multiple_raster_threads: enabled_on<br>opengl: enabled_on<br>rasterization: enabled<br>raw_draw: disabled_off_ok<br>skia_graphite: disabled_off<br>video_decode: enabled<br>video_encode: enabled<br>vulkan: disabled_off<br>webgl: enabled<br>webgl2: enabled<br>webgpu: enabled|
|Load (avg)|undefined|
|Memory (System)|63.71GB (29.44GB free)|
|Process Argv|--crash-reporter-id 2058db1e-f1e8-433e-bf38-476163c306a2|
|Screen Reader|no|
|VM|0%|
</details><details>
<summary>A/B Experiments</summary>

vsliv368cf:30146710 vspor879:30202332 vspor708:30202333 vspor363:30204092 vscod805:30301674 binariesv615:30325510 vsaa593cf:30376535 py29gd2263:30899288 c4g48928:30535728 azure-dev_surveyone:30548225 a9j8j154:30646983 962ge761:30959799 pythongtdpath:30769146 welcomedialogc:30910334 pythonidxpt:30866567 pythonnoceb:30805159 asynctok:30898717 pythontestfixt:30902429 pythonregdiag2:30936856 pyreplss1:30897532 pythonmypyd1:30879173 pythoncet0:30885854 h48ei257:31000450 pythontbext0:30879054 accentitlementst:30995554 dsvsc016:30899300 dsvsc017:30899301 dsvsc018:30899302 cppperfnew:31000557 d34g3935:30971562 fegfb526:30981948 bg6jg535:30979843 ccp2r3:30993541 dsvsc020:30976470 pythonait:31006305 7ghi1836:30988842 dsvsc021:30996838 gd77d436:30999572



</details>

<!-- generated by issue reporter -->
bzorn commented 5 months ago

Actually occurs because I didn't have the Bing API key in my credentials. The error message should be clearer.