-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gai: Work in progress on scripting extensions ("party mode" implement…
…ed).
- Loading branch information
1 parent
826a8c3
commit 59b8a45
Showing
13 changed files
with
130 additions
and
72 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
|
||
// generated by the build script for dev time | ||
// generated by the build script | ||
chat_scripting_api.js | ||
chat_scripting_api.d.ts |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,21 @@ | ||
/// Let the IDE see the types from the chat_scripting_api during development. | ||
/// <reference path="../chat_scripting_api.ts" /> | ||
|
||
console.log('Test Script: Evaluating JavaScript code from Dart...'); | ||
(async () => { | ||
console.log('test_script: Evaluating JavaScript code from Dart...'); | ||
console.log('test_script: Chat History:', chatHistory); | ||
|
||
console.log('Chat History:', chatHistory); | ||
const chatMessage = new ChatMessage( | ||
ChatMessageSource.SYSTEM, | ||
'Extension: Test Script', | ||
{'foo': 'bar'} | ||
); | ||
addChatMessage(chatMessage); | ||
|
||
const chatMessage = new ChatMessage( | ||
ChatMessageSource.SYSTEM, | ||
'Extension: Test Script', | ||
{'foo': 'bar'} | ||
); | ||
addChatMessage(chatMessage); | ||
const promise = sendMessagesToModel([chatMessage], 'test-model', null); | ||
const result = await promise; | ||
console.log(`test_script: awaited 2 sendMessagesToModel. Result from dart: ${result}`); | ||
|
||
var result = sendMessagesToModel([chatMessage], 'test-model', 999); | ||
console.log('sendMessagesToModel Result from dart:', result); | ||
return 42; | ||
})(); | ||
|
||
// Return a result | ||
const returnResult = 42; | ||
returnResult; |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// This is just for the IDE to tell it the typescript level | ||
// See build-scripting.sh for the tsc options. | ||
{ | ||
"compilerOptions": { | ||
"target": "es2020", | ||
// "module": "es2022", | ||
// "moduleResolution": "node", | ||
"strict": true | ||
} | ||
} |