ballerina-lang icon indicating copy to clipboard operation
ballerina-lang copied to clipboard

[Bug]: VSCode notebook doesnt render json

Open rdmolony opened this issue 11 months ago • 0 comments

Description

I was playing with https://central.ballerina.io/ballerinax/openai.chat/2.0.1 in a VSCode Ballerina notebook & I noticed that json[] wasn't rendering.

The following ...

json[] messages = [
    {"role": "system", "content": "You are a helpful assistant."},
    {"role": "user", "content": "Who won the world series in 2020?"}
]

... fails with ...

Error loading renderer 'ballerina-notebook-renderer'
 - be.activate is not a function

... while it works fine in bal shell so no biggie

Steps to Reproduce

See Description

Affected Version(s)

Ballerina 2201.8.6 (Swan Lake Update 8) Language specification 2023R1 Update Tool 1.4.2

Dependencies.toml
# AUTO-GENERATED FILE. DO NOT MODIFY.

# This file is auto-generated by Ballerina for managing dependency versions.
# It should not be modified by hand.

[ballerina]
dependencies-toml-version = "2"
distribution-version = "2201.8.6"

[[package]]
org = "ballerina"
name = "auth"
version = "2.10.0"
dependencies = [
	{org = "ballerina", name = "crypto"},
	{org = "ballerina", name = "jballerina.java"},
	{org = "ballerina", name = "lang.array"},
	{org = "ballerina", name = "lang.string"},
	{org = "ballerina", name = "log"}
]

[[package]]
org = "ballerina"
name = "cache"
version = "3.7.1"
dependencies = [
	{org = "ballerina", name = "constraint"},
	{org = "ballerina", name = "jballerina.java"},
	{org = "ballerina", name = "task"},
	{org = "ballerina", name = "time"}
]

[[package]]
org = "ballerina"
name = "constraint"
version = "1.5.0"
dependencies = [
	{org = "ballerina", name = "jballerina.java"}
]

[[package]]
org = "ballerina"
name = "crypto"
version = "2.6.2"
dependencies = [
	{org = "ballerina", name = "jballerina.java"},
	{org = "ballerina", name = "time"}
]

[[package]]
org = "ballerina"
name = "file"
version = "1.9.0"
dependencies = [
	{org = "ballerina", name = "io"},
	{org = "ballerina", name = "jballerina.java"},
	{org = "ballerina", name = "os"},
	{org = "ballerina", name = "time"}
]

[[package]]
org = "ballerina"
name = "http"
version = "2.10.12"
dependencies = [
	{org = "ballerina", name = "auth"},
	{org = "ballerina", name = "cache"},
	{org = "ballerina", name = "constraint"},
	{org = "ballerina", name = "crypto"},
	{org = "ballerina", name = "file"},
	{org = "ballerina", name = "io"},
	{org = "ballerina", name = "jballerina.java"},
	{org = "ballerina", name = "jwt"},
	{org = "ballerina", name = "lang.array"},
	{org = "ballerina", name = "lang.decimal"},
	{org = "ballerina", name = "lang.int"},
	{org = "ballerina", name = "lang.regexp"},
	{org = "ballerina", name = "lang.runtime"},
	{org = "ballerina", name = "lang.string"},
	{org = "ballerina", name = "lang.value"},
	{org = "ballerina", name = "log"},
	{org = "ballerina", name = "mime"},
	{org = "ballerina", name = "oauth2"},
	{org = "ballerina", name = "observe"},
	{org = "ballerina", name = "time"},
	{org = "ballerina", name = "url"}
]
modules = [
	{org = "ballerina", packageName = "http", moduleName = "http"},
	{org = "ballerina", packageName = "http", moduleName = "http.httpscerr"}
]

[[package]]
org = "ballerina"
name = "io"
version = "1.6.0"
dependencies = [
	{org = "ballerina", name = "jballerina.java"},
	{org = "ballerina", name = "lang.value"}
]

[[package]]
org = "ballerina"
name = "jballerina.java"
version = "0.0.0"

[[package]]
org = "ballerina"
name = "jwt"
version = "2.10.0"
dependencies = [
	{org = "ballerina", name = "cache"},
	{org = "ballerina", name = "crypto"},
	{org = "ballerina", name = "jballerina.java"},
	{org = "ballerina", name = "lang.int"},
	{org = "ballerina", name = "lang.string"},
	{org = "ballerina", name = "log"},
	{org = "ballerina", name = "time"}
]

[[package]]
org = "ballerina"
name = "lang.__internal"
version = "0.0.0"
dependencies = [
	{org = "ballerina", name = "jballerina.java"},
	{org = "ballerina", name = "lang.object"}
]

[[package]]
org = "ballerina"
name = "lang.array"
version = "0.0.0"
dependencies = [
	{org = "ballerina", name = "jballerina.java"},
	{org = "ballerina", name = "lang.__internal"}
]

[[package]]
org = "ballerina"
name = "lang.decimal"
version = "0.0.0"
dependencies = [
	{org = "ballerina", name = "jballerina.java"}
]

[[package]]
org = "ballerina"
name = "lang.int"
version = "0.0.0"
dependencies = [
	{org = "ballerina", name = "jballerina.java"},
	{org = "ballerina", name = "lang.__internal"},
	{org = "ballerina", name = "lang.object"}
]

[[package]]
org = "ballerina"
name = "lang.object"
version = "0.0.0"

[[package]]
org = "ballerina"
name = "lang.regexp"
version = "0.0.0"
dependencies = [
	{org = "ballerina", name = "jballerina.java"}
]

[[package]]
org = "ballerina"
name = "lang.runtime"
version = "0.0.0"
dependencies = [
	{org = "ballerina", name = "jballerina.java"}
]

[[package]]
org = "ballerina"
name = "lang.string"
version = "0.0.0"
dependencies = [
	{org = "ballerina", name = "jballerina.java"},
	{org = "ballerina", name = "lang.regexp"}
]

[[package]]
org = "ballerina"
name = "lang.value"
version = "0.0.0"
dependencies = [
	{org = "ballerina", name = "jballerina.java"}
]

[[package]]
org = "ballerina"
name = "log"
version = "2.9.0"
dependencies = [
	{org = "ballerina", name = "io"},
	{org = "ballerina", name = "jballerina.java"},
	{org = "ballerina", name = "lang.value"},
	{org = "ballerina", name = "observe"}
]

[[package]]
org = "ballerina"
name = "mime"
version = "2.9.0"
dependencies = [
	{org = "ballerina", name = "io"},
	{org = "ballerina", name = "jballerina.java"},
	{org = "ballerina", name = "lang.int"}
]

[[package]]
org = "ballerina"
name = "oauth2"
version = "2.10.0"
dependencies = [
	{org = "ballerina", name = "cache"},
	{org = "ballerina", name = "crypto"},
	{org = "ballerina", name = "jballerina.java"},
	{org = "ballerina", name = "log"},
	{org = "ballerina", name = "time"},
	{org = "ballerina", name = "url"}
]

[[package]]
org = "ballerina"
name = "observe"
version = "1.2.2"
dependencies = [
	{org = "ballerina", name = "jballerina.java"}
]

[[package]]
org = "ballerina"
name = "os"
version = "1.8.0"
dependencies = [
	{org = "ballerina", name = "io"},
	{org = "ballerina", name = "jballerina.java"}
]

[[package]]
org = "ballerina"
name = "task"
version = "2.5.0"
dependencies = [
	{org = "ballerina", name = "jballerina.java"},
	{org = "ballerina", name = "time"}
]

[[package]]
org = "ballerina"
name = "time"
version = "2.4.0"
dependencies = [
	{org = "ballerina", name = "jballerina.java"}
]

[[package]]
org = "ballerina"
name = "url"
version = "2.4.0"
dependencies = [
	{org = "ballerina", name = "jballerina.java"}
]

[[package]]
org = "ballerinai"
name = "observe"
version = "0.0.0"
dependencies = [
	{org = "ballerina", name = "jballerina.java"},
	{org = "ballerina", name = "observe"}
]
modules = [
	{org = "ballerinai", packageName = "observe", moduleName = "observe"}
]

[[package]]
org = "ballerinax"
name = "openai.chat"
version = "2.0.1"
dependencies = [
	{org = "ballerina", name = "constraint"},
	{org = "ballerina", name = "http"},
	{org = "ballerina", name = "url"},
	{org = "ballerinai", name = "observe"}
]
modules = [
	{org = "ballerinax", packageName = "openai.chat", moduleName = "openai.chat"}
]

[[package]]
org = "rowanm"
name = "chatgpt_ballerina_integration"
version = "0.1.0"
dependencies = [
	{org = "ballerina", name = "http"},
	{org = "ballerinai", name = "observe"},
	{org = "ballerinax", name = "openai.chat"}
]
modules = [
	{org = "rowanm", packageName = "chatgpt_ballerina_integration", moduleName = "chatgpt_ballerina_integration"}
]

OS, DB, other environment details and versions

VSCode -

Version: 1.87.2 (user setup) Commit: 863d2581ecda6849923a2118d93a088b0745d9d6 Date: 2024-03-08T15:20:17.278Z Electron: 27.3.2 ElectronBuildId: 26836302 Chromium: 118.0.5993.159 Node.js: 18.17.1 V8: 11.8.172.18-electron.0 OS: Windows_NT x64 10.0.19045

OS -

Device name Windows Processor Intel(R) Core(TM) i5-4690 CPU @ 3.50GHz 3.50 GHz Installed RAM 16.0 GB Device ID 9FDD14C0-15A4-4D13-B5A0-8978CE5EC5C3 Product ID 00326-10860-37563-AA443 System type 64-bit operating system, x64-based processor Pen and touch No pen or touch input is available for this display

Related area

-> Editor

Related issue(s) (optional)

No response

Suggested label(s) (optional)

No response

Suggested assignee(s) (optional)

No response


Btw I'm finding it very interesting exploring this language to glue a frontend with OpenAI, huge congrats for bringing it to this point. Such a nice dev experience so far 😃

rdmolony avatar Mar 22 '24 17:03 rdmolony