Skip to content

Commit

Permalink
add app context feature; implement functions to update and retrieve c…
Browse files Browse the repository at this point in the history
…ontext data in GenAICode
  • Loading branch information
gtanczyk committed Jan 31, 2025
1 parent 4d98381 commit b4737fc
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions games/hungry-lion/.genaicoderc
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
"plugins": [
"genaicode-debug-plugin.js"
],
"featuresEnabled": {
"appContext": true
},
"modelOverrides": {
"aiStudio": {
"default": "gemini-exp-1206",
Expand Down
13 changes: 13 additions & 0 deletions games/hungry-lion/src/utils/genaicode-context.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { contextManager } from 'genaicode/vite-context';

// Those functions can be used to store and retrieve app context data in GenAICode:
// - GenAIcode can use this data to optimize the code generation process
// - GenAIcode can update context to modify the application behavior

export async function updateAppContext(key: string, value: string) {
await contextManager.setContext(key, value);
}

export async function getAppContext(key: string) {
return await contextManager.getContext(key);
}

0 comments on commit b4737fc

Please sign in to comment.