Skip to content

Commit

Permalink
use npx in cli docs
Browse files Browse the repository at this point in the history
  • Loading branch information
pelikhan committed Mar 19, 2024
1 parent 14ac2ae commit 6f9e929
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 19 deletions.
12 changes: 6 additions & 6 deletions docs/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ export default defineConfig({
label: "Start Here",
autogenerate: { directory: "getting-started" },
},
{
label: "Guides",
autogenerate: { directory: "guides" },
},
{
label: "Case Studies",
autogenerate: { directory: "case-studies" },
},
{
label: "Guides",
autogenerate: { directory: "guides" },
},
{
label: "Reference",
autogenerate: { directory: "reference" },
Expand All @@ -42,8 +42,8 @@ export default defineConfig({
},
{
label: "Contributing",
link: "https://github.com/microsoft/genaiscript/blob/main/CONTRIBUTING.md"
}
link: "https://github.com/microsoft/genaiscript/blob/main/CONTRIBUTING.md",
},
],
}),
],
Expand Down
6 changes: 4 additions & 2 deletions docs/src/content/docs/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ import { FileTree } from "@astrojs/starlight/components"
// define the context
def("FILE", env.files, { endsWith: ".pdf" })
// structure the data
const schema = defSchema("DATA", { type: "array", items: { type: "string" } })
const schema = defSchema("DATA",
{ type: "array", items: { type: "string" } })
// assign the task
$`Analyze FILE and extract data to JSON using the ${schema} schema.`
$`Analyze FILE and
extract data to JSON using the ${schema} schema.`
```

## Next steps
Expand Down
8 changes: 4 additions & 4 deletions packages/cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
Scripting environment with convinient tooling for file ingestion, prompt development and structured data extraction.

```js
// metadata and model configuration
script({ title: "Title Extractor", model: "gpt4" })
// define the context
def("FILE", env.files, { endsWith: ".pdf" })
// define the data
const chema = defSchema("DATA", { type: "array", items: { type: "string" } })
const chema = defSchema("DATA",
{ type: "array", items: { type: "string" } })
// define the task
$`Analyze FILE and extract titles to JSON compliant with ${schema}.`
$`Analyze FILE and
extract titles to JSON compliant with ${schema}.`
```

- **Read the online documentation at https://microsoft.github.io/genaiscript/**
Expand Down
7 changes: 4 additions & 3 deletions packages/core/src/clihelp.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { RunTemplateOptions } from "."
import { Fragment } from "./ast"
import { GENAISCRIPT_CLI_JS } from "./constants"
import { GENAISCRIPT_CLI_JS, NPM_CLI_PACKAGE } from "./constants"
import { MarkdownTrace } from "./trace"

export function generateCliArguments(
Expand All @@ -12,8 +12,9 @@ export function generateCliArguments(
const { model, temperature, topP, seed, cliInfo } = options

const cli = [
"node",
GENAISCRIPT_CLI_JS,
"npx",
"--yes",
NPM_CLI_PACKAGE,
command,
template.id,
`"${cliInfo.spec}"`,
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ export const RETRIEVAL_DEFAULT_INDEX = "default"
export const RETRIEVAL_DEFAULT_MODEL = "gpt-4"
export const SYSTEM_FENCE = "---"
export const MAX_DATA_REPAIRS = 1
export const NPM_CLI_PACKAGE = "genaiscript-cli"
8 changes: 4 additions & 4 deletions packages/vscode/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
Scripting environment with convinient tooling for file ingestion, prompt development and structured data extraction.

```js
// metadata and model configuration
script({ title: "Title Extractor", model: "gpt4" })
// define the context
def("FILE", env.files, { endsWith: ".pdf" })
// define the data
const chema = defSchema("DATA", { type: "array", items: { type: "string" } })
const chema = defSchema("DATA",
{ type: "array", items: { type: "string" } })
// define the task
$`Analyze FILE and extract titles to JSON compliant with ${schema}.`
$`Analyze FILE and
extract titles to JSON compliant with ${schema}.`
```

- **Read the online documentation at https://microsoft.github.io/genaiscript/**
Expand Down

0 comments on commit 6f9e929

Please sign in to comment.