Skip to content

Commit

Permalink
passing parameters from vscode to server
Browse files Browse the repository at this point in the history
  • Loading branch information
pelikhan committed Aug 16, 2024
1 parent aa2453e commit 0b739e6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/core/src/parameters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,3 +123,8 @@ export function parsePromptParameters(
}
return Object.freeze(res)
}

export function parametersToVars(parameters: PromptParameters): string[] {
if (!parameters) return undefined
return Object.keys(parameters).map((k) => `${k}=${parameters[k]}`)
}
2 changes: 2 additions & 0 deletions packages/vscode/src/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import {
} from "../../core/src/util"
import { CORE_VERSION } from "../../core/src/version"
import { Fragment, GenerationResult } from "../../core/src/generation"
import { parametersToVars } from "../../core/src/parameters"

export const FRAGMENTS_CHANGE = "fragmentsChange"
export const AI_REQUEST_CHANGE = "aiRequestChange"
Expand Down Expand Up @@ -331,6 +332,7 @@ tests/
partialCb,
label,
cache: cache && template.cache,
vars: parametersToVars(options.parameters),
}
)
r.runId = runId
Expand Down

0 comments on commit 0b739e6

Please sign in to comment.