diff --git a/.github/prompts/genaiscript.prompt.md b/.github/prompts/genaiscript.prompt.md index cb0d4732a6..50a44f67be 100644 --- a/.github/prompts/genaiscript.prompt.md +++ b/.github/prompts/genaiscript.prompt.md @@ -5,7 +5,7 @@ Your task is to generate a GenAIScript script or answer questions about GenAIScr ## Reference -- [GenAIScript docs](./.genaiscript/docs/llms-full.txt) +- [GenAIScript docs](../../.genaiscript/docs/llms-full.txt) ## Guidance for Code Generation diff --git a/.github/workflows/azure.yml b/.github/workflows/azure.yml index 2a0b4bbc9a..85d670899a 100644 --- a/.github/workflows/azure.yml +++ b/.github/workflows/azure.yml @@ -30,7 +30,7 @@ jobs: - name: compile run: yarn compile:action - name: poem - run: yarn run:script poem --model azure:gpt-4o -tlp 5 --out-trace $GITHUB_STEP_SUMMARY + run: yarn run:script poem --model azure:gpt-4.1 -tlp 5 --out-trace $GITHUB_STEP_SUMMARY env: AZURE_OPENAI_API_ENDPOINT: ${{ secrets.AZURE_OPENAI_API_ENDPOINT }} AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }} diff --git a/.github/workflows/genai-blog-post.yml b/.github/workflows/genai-blog-post.yml index fa0568a023..86e714d957 100644 --- a/.github/workflows/genai-blog-post.yml +++ b/.github/workflows/genai-blog-post.yml @@ -1,15 +1,11 @@ name: genai blog post generator on: workflow_dispatch: + schedule: + - cron: '0 0 * * *' concurrency: - group: ${{ github.workflow }}-${{ github.ref }} + group: blog-post-${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true -env: - GENAISCRIPT_DEFAULT_REASONING_MODEL: ${{ vars.GENAISCRIPT_DEFAULT_REASONING_MODEL }} - GENAISCRIPT_DEFAULT_REASONING_SMALL_MODEL: ${{ vars.GENAISCRIPT_DEFAULT_REASONING_SMALL_MODEL }} - GENAISCRIPT_DEFAULT_MODEL: ${{ vars.GENAISCRIPT_DEFAULT_MODEL }} - GENAISCRIPT_DEFAULT_SMALL_MODEL: ${{ vars.GENAISCRIPT_DEFAULT_SMALL_MODEL }} - GENAISCRIPT_DEFAULT_VISION_MODEL: ${{ vars.GENAISCRIPT_DEFAULT_VISION_MODEL }} jobs: build: runs-on: ubuntu-latest @@ -22,6 +18,7 @@ jobs: with: submodules: "recursive" fetch-depth: 10 + ref: dev - uses: actions/setup-node@v4 with: node-version: "20" @@ -30,9 +27,7 @@ jobs: - name: compile run: yarn compile - name: generate blog post - run: yarn genai:blog-post --out-trace $GITHUB_STEP_SUMMARY - - name: docs - run: yarn build:docs + run: yarn genai:blog-post -p github --out-trace $GITHUB_STEP_SUMMARY - uses: stefanzweifel/git-auto-commit-action@v5 with: file_pattern: "docs/src/content/docs/blog/drafts/*.md" diff --git a/.github/workflows/genai-commander.yml b/.github/workflows/genai-commander.yml index 32aedf7e7d..9ace478afd 100644 --- a/.github/workflows/genai-commander.yml +++ b/.github/workflows/genai-commander.yml @@ -2,12 +2,6 @@ name: genai commander on: issue_comment: types: [created] -env: - GENAISCRIPT_DEFAULT_REASONING_MODEL: ${{ vars.GENAISCRIPT_DEFAULT_REASONING_MODEL }} - GENAISCRIPT_DEFAULT_REASONING_SMALL_MODEL: ${{ vars.GENAISCRIPT_DEFAULT_REASONING_SMALL_MODEL }} - GENAISCRIPT_DEFAULT_MODEL: ${{ vars.GENAISCRIPT_DEFAULT_MODEL }} - GENAISCRIPT_DEFAULT_SMALL_MODEL: ${{ vars.GENAISCRIPT_DEFAULT_SMALL_MODEL }} - GENAISCRIPT_DEFAULT_VISION_MODEL: ${{ vars.GENAISCRIPT_DEFAULT_VISION_MODEL }} jobs: pr_commented: # must be PR and have a comment starting with /genai @@ -16,6 +10,7 @@ jobs: permissions: contents: read pull-requests: write + models: read steps: # only allow PRs from the same repository - name: Check if PR is from the same repository @@ -79,23 +74,16 @@ jobs: run: yarn install --frozen-lockfile - name: compile run: yarn compile - # - # Start Ollama in a docker container - # - - name: start ollama - run: yarn ollama:start - # Execute the /genai found in the comment - # - name: genaiscript pr-describe if: startsWith(github.event.comment.body, '/genai describe') - run: node packages/cli/built/genaiscript.cjs run pr-describe -prd --out-trace $GITHUB_STEP_SUMMARY --vars defaultBranch=dev + run: node packages/cli/built/genaiscript.cjs run pr-describe -p github -prd --out-trace $GITHUB_STEP_SUMMARY --vars defaultBranch=dev env: GITHUB_ISSUE: ${{ github.event.issue.number }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_COMMIT_SHA: ${{ fromJSON(steps.sha.outputs.result).sha }} - name: genaiscript pr-review if: startsWith(github.event.comment.body, '/genai review') - run: node packages/cli/built/genaiscript.cjs run pr-review -prc --out-trace $GITHUB_STEP_SUMMARY --vars defaultBranch=dev + run: node packages/cli/built/genaiscript.cjs run pr-review -p github -prc --out-trace $GITHUB_STEP_SUMMARY --vars defaultBranch=dev env: GITHUB_ISSUE: ${{ github.event.issue.number }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/genai-docs.yml b/.github/workflows/genai-docs.yml new file mode 100644 index 0000000000..955481b73a --- /dev/null +++ b/.github/workflows/genai-docs.yml @@ -0,0 +1,53 @@ +name: genai docs +on: + workflow_dispatch: + pull_request: + types: [review_requested] + paths: + - "packages/**/*.ts" +concurrency: + group: docs-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true +jobs: + gen-docs: + runs-on: ubuntu-latest + permissions: + pull-requests: write + contents: write + models: read + steps: + - uses: actions/checkout@v4 + with: + submodules: "recursive" + fetch-depth: 10 + ref: ${{ github.head_ref }} + - uses: actions/setup-node@v4 + with: + node-version: "20" + cache: yarn + - run: yarn install --frozen-lockfile + - name: compile + run: yarn compile + - name: git fetch dev + run: git fetch origin && git pull origin dev:dev + - name: /docs + run: node packages/cli/built/genaiscript.cjs run docs "packages/**/*.ts" --out ./temp/genai/docs -prc -p github --out-trace $GITHUB_STEP_SUMMARY --vars diff=true --vars pretty=true --vars applyEdits=true --vars defaultBranch=dev + env: + DEBUG: "script*" + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_COMMIT_SHA: ${{ github.event.pull_request.base.sha}} + - name: typecheck + run: yarn typecheck + - name: git status + run: git status + - name: commit + uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: "genai: /docs [skip ci]" + commit_user_name: "genaiscript" + - name: archive + if: always() + uses: actions/upload-artifact@v4 + with: + name: genai-results + path: ./temp/genai/** diff --git a/.github/workflows/genai-investigator.yml b/.github/workflows/genai-investigator.yml index 0227665bef..d846b24e0f 100644 --- a/.github/workflows/genai-investigator.yml +++ b/.github/workflows/genai-investigator.yml @@ -11,12 +11,7 @@ permissions: contents: read actions: read pull-requests: write -env: - GENAISCRIPT_DEFAULT_REASONING_MODEL: ${{ vars.GENAISCRIPT_DEFAULT_REASONING_MODEL }} - GENAISCRIPT_DEFAULT_REASONING_SMALL_MODEL: ${{ vars.GENAISCRIPT_DEFAULT_REASONING_SMALL_MODEL }} - GENAISCRIPT_DEFAULT_MODEL: ${{ vars.GENAISCRIPT_DEFAULT_MODEL }} - GENAISCRIPT_DEFAULT_SMALL_MODEL: ${{ vars.GENAISCRIPT_DEFAULT_SMALL_MODEL }} - GENAISCRIPT_DEFAULT_VISION_MODEL: ${{ vars.GENAISCRIPT_DEFAULT_VISION_MODEL }} + models: read jobs: investigate: # Only run this job if the workflow run concluded with a failure @@ -35,23 +30,18 @@ jobs: - run: yarn install --frozen-lockfile - name: compile run: yarn compile - # - # Start Ollama in a docker container - # - - name: start ollama - run: docker run -d -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama - name: genaiscript gai - run: node packages/cli/built/genaiscript.cjs run gai -pr ${{ github.event.workflow_run.pull_requests[0].number }} -prc --vars "workflow=${{ github.event.workflow_run.workflow_id }}" --vars "failure_run_id=${{ github.event.workflow_run.id }}" --out-trace $GITHUB_STEP_SUMMARY + run: node packages/cli/built/genaiscript.cjs run gai -p github -pr ${{ github.event.workflow_run.pull_requests[0].number }} -prc --vars "workflow=${{ github.event.workflow_run.workflow_id }}" --vars "failure_run_id=${{ github.event.workflow_run.id }}" --out-trace $GITHUB_STEP_SUMMARY env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GENAISCRIPT_VAR_BRANCH: ${{ github.event.workflow_run.head_branch }} - name: genaiscript github-agent - run: node packages/cli/built/genaiscript.cjs run github-agent -pr ${{ github.event.workflow_run.pull_requests[0].number }} -prc --vars "workflow=${{ github.event.workflow_run.workflow_id }}" --vars "failure_run_id=${{ github.event.workflow_run.id }}" --out-trace $GITHUB_STEP_SUMMARY + run: node packages/cli/built/genaiscript.cjs run github-agent -p github -pr ${{ github.event.workflow_run.pull_requests[0].number }} -prc --vars "workflow=${{ github.event.workflow_run.workflow_id }}" --vars "failure_run_id=${{ github.event.workflow_run.id }}" --out-trace $GITHUB_STEP_SUMMARY env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GENAISCRIPT_VAR_BRANCH: ${{ github.event.workflow_run.head_branch }} - name: genaiscript github-one - run: node packages/cli/built/genaiscript.cjs run github-one -pr ${{ github.event.workflow_run.pull_requests[0].number }} -prc --vars "workflow=${{ github.event.workflow_run.workflow_id }}" --vars "failure_run_id=${{ github.event.workflow_run.id }}" --out-trace $GITHUB_STEP_SUMMARY + run: node packages/cli/built/genaiscript.cjs run github-one -p github -pr ${{ github.event.workflow_run.pull_requests[0].number }} -prc --vars "workflow=${{ github.event.workflow_run.workflow_id }}" --vars "failure_run_id=${{ github.event.workflow_run.id }}" --out-trace $GITHUB_STEP_SUMMARY env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GENAISCRIPT_VAR_BRANCH: ${{ github.event.workflow_run.head_branch }} diff --git a/.github/workflows/genai-issue-bot.yml b/.github/workflows/genai-issue-bot.yml index 8903d6665c..66f75e4753 100644 --- a/.github/workflows/genai-issue-bot.yml +++ b/.github/workflows/genai-issue-bot.yml @@ -5,18 +5,13 @@ on: concurrency: group: issue-bot-${{ github.event.issue.number }} cancel-in-progress: true -env: - GENAISCRIPT_DEFAULT_REASONING_MODEL: ${{ vars.GENAISCRIPT_DEFAULT_REASONING_MODEL }} - GENAISCRIPT_DEFAULT_REASONING_SMALL_MODEL: ${{ vars.GENAISCRIPT_DEFAULT_REASONING_SMALL_MODEL }} - GENAISCRIPT_DEFAULT_MODEL: ${{ vars.GENAISCRIPT_DEFAULT_MODEL }} - GENAISCRIPT_DEFAULT_SMALL_MODEL: ${{ vars.GENAISCRIPT_DEFAULT_SMALL_MODEL }} - GENAISCRIPT_DEFAULT_VISION_MODEL: ${{ vars.GENAISCRIPT_DEFAULT_VISION_MODEL }} jobs: reason: runs-on: ubuntu-latest permissions: contents: read issues: write + models: read steps: - uses: actions/checkout@v4 with: @@ -32,7 +27,7 @@ jobs: - name: start ollama run: yarn ollama:start - name: genaiscript issue-review - run: node packages/cli/built/genaiscript.cjs run issue-bot -prc bot --out-output $GITHUB_STEP_SUMMARY + run: node packages/cli/built/genaiscript.cjs run issue-bot -p github -prc bot --out-output $GITHUB_STEP_SUMMARY env: GITHUB_ISSUE: ${{ github.event.issue.number }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/genai-issue-review.yml b/.github/workflows/genai-issue-review.yml index b321c7d3ff..53670e6883 100644 --- a/.github/workflows/genai-issue-review.yml +++ b/.github/workflows/genai-issue-review.yml @@ -5,18 +5,13 @@ on: concurrency: group: issues-${{ github.event.issue.number }} cancel-in-progress: true -env: - GENAISCRIPT_DEFAULT_REASONING_MODEL: ${{ vars.GENAISCRIPT_DEFAULT_REASONING_MODEL }} - GENAISCRIPT_DEFAULT_REASONING_SMALL_MODEL: ${{ vars.GENAISCRIPT_DEFAULT_REASONING_SMALL_MODEL }} - GENAISCRIPT_DEFAULT_MODEL: ${{ vars.GENAISCRIPT_DEFAULT_MODEL }} - GENAISCRIPT_DEFAULT_SMALL_MODEL: ${{ vars.GENAISCRIPT_DEFAULT_SMALL_MODEL }} - GENAISCRIPT_DEFAULT_VISION_MODEL: ${{ vars.GENAISCRIPT_DEFAULT_VISION_MODEL }} jobs: build: runs-on: ubuntu-latest permissions: contents: read issues: write + models: read steps: - uses: actions/checkout@v4 with: @@ -29,10 +24,8 @@ jobs: - run: yarn install --frozen-lockfile - name: compile run: yarn compile - - name: start ollama - run: yarn ollama:start - name: genaiscript issue-review - run: node packages/cli/built/genaiscript.cjs run issue-reviewer -prc --out-trace $GITHUB_STEP_SUMMARY + run: node packages/cli/built/genaiscript.cjs run issue-reviewer -p github -prc --out-trace $GITHUB_STEP_SUMMARY env: GITHUB_ISSUE: ${{ github.event.issue.number }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/genai-linters.yml b/.github/workflows/genai-linters.yml new file mode 100644 index 0000000000..903f486443 --- /dev/null +++ b/.github/workflows/genai-linters.yml @@ -0,0 +1,49 @@ +name: genai linters +on: + workflow_dispatch: + pull_request: + types: [opened, ready_for_review, reopened, review_requested] + paths: + - "docs/**" + - "genaisrc/**" + - "packages/core/**/*" + - "packages/cli/**/*" + - "packages/samples/**/*" + - "packages/vscode/**/*" +concurrency: + group: linters-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true +env: + GENAISCRIPT_MODEL_LINTER: ${{ vars.GENAISCRIPT_MODEL_LINTER }} +jobs: + lint: + runs-on: ubuntu-latest + permissions: + pull-requests: write + models: read + steps: + - uses: actions/checkout@v4 + with: + submodules: "recursive" + fetch-depth: 10 + - uses: actions/setup-node@v4 + with: + node-version: "20" + cache: yarn + - run: yarn install --frozen-lockfile + - name: compile + run: yarn compile + - name: git stuff + run: git fetch origin && git pull origin dev:dev + - name: genaiscript + run: node packages/cli/built/genaiscript.cjs run linters --out ./temp/genai/linters -prr -prc -m linter --out-trace $GITHUB_STEP_SUMMARY --vars defaultBranch=dev + continue-on-error: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_COMMIT_SHA: ${{ github.event.pull_request.base.sha}} + - name: Archive genai results + if: always() + uses: actions/upload-artifact@v4 + with: + name: genai-results + path: ./temp/genai/** diff --git a/.github/workflows/genai-pr-commit-review.yml b/.github/workflows/genai-pr-commit-review.yml index 5d16429ce4..a66bcfca78 100644 --- a/.github/workflows/genai-pr-commit-review.yml +++ b/.github/workflows/genai-pr-commit-review.yml @@ -18,6 +18,7 @@ jobs: runs-on: ubuntu-latest permissions: pull-requests: write + models: read steps: - uses: actions/checkout@v4 with: diff --git a/.github/workflows/genai-pr-docs-commit-review.yml b/.github/workflows/genai-pr-docs-commit-review.yml index 15c316aae8..0b3c630871 100644 --- a/.github/workflows/genai-pr-docs-commit-review.yml +++ b/.github/workflows/genai-pr-docs-commit-review.yml @@ -15,6 +15,7 @@ jobs: runs-on: ubuntu-latest permissions: pull-requests: write + models: read steps: - uses: actions/checkout@v4 with: diff --git a/.github/workflows/genai-pr-review.yml b/.github/workflows/genai-pr-review.yml index 12fd2a98a0..c962d0ff77 100644 --- a/.github/workflows/genai-pr-review.yml +++ b/.github/workflows/genai-pr-review.yml @@ -9,19 +9,16 @@ on: - "packages/cli/**/*" - "packages/samples/**/*" concurrency: - group: ${{ github.workflow }}-${{ github.ref }} + group: pr-review-${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true env: - GENAISCRIPT_DEFAULT_REASONING_MODEL: ${{ vars.GENAISCRIPT_DEFAULT_REASONING_MODEL }} - GENAISCRIPT_DEFAULT_REASONING_SMALL_MODEL: ${{ vars.GENAISCRIPT_DEFAULT_REASONING_SMALL_MODEL }} - GENAISCRIPT_DEFAULT_MODEL: ${{ vars.GENAISCRIPT_DEFAULT_MODEL }} - GENAISCRIPT_DEFAULT_SMALL_MODEL: ${{ vars.GENAISCRIPT_DEFAULT_SMALL_MODEL }} - GENAISCRIPT_DEFAULT_VISION_MODEL: ${{ vars.GENAISCRIPT_DEFAULT_VISION_MODEL }} + GENAISCRIPT_MODEL_REVIEW: ${{ vars.GENAISCRIPT_MODEL_REVIEW }} jobs: build: runs-on: ubuntu-latest permissions: pull-requests: write + models: read steps: - uses: actions/checkout@v4 with: @@ -40,11 +37,11 @@ jobs: run: git fetch origin && git pull origin dev:dev - name: genaiscript pr-describe continue-on-error: true - run: node packages/cli/built/genaiscript.cjs run pr-describe --out ./temp/genai/pr-describe -prd -m reasoning --out-trace $GITHUB_STEP_SUMMARY --vars defaultBranch=dev + run: node packages/cli/built/genaiscript.cjs run pr-describe --out ./temp/genai/pr-describe -prd -m review --out-trace $GITHUB_STEP_SUMMARY --vars defaultBranch=dev env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: genaiscript pr-review - run: node packages/cli/built/genaiscript.cjs run pr-review --out ./temp/genai/pr-review -prc -m reasoning --out-trace $GITHUB_STEP_SUMMARY --vars defaultBranch=dev + run: node packages/cli/built/genaiscript.cjs run pr-review --out ./temp/genai/pr-review -prc -m review --out-trace $GITHUB_STEP_SUMMARY --vars defaultBranch=dev continue-on-error: true env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index 044022a089..e09dde5deb 100644 --- a/.gitignore +++ b/.gitignore @@ -41,3 +41,4 @@ packages/sample/src/mlads/* packages/core/src/dbg.ts TypeScript/ react/ +docs/public/blog/*.mp4 diff --git a/.vscode/launch.json b/.vscode/launch.json index f0b4c5eb88..282431b3d6 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -29,7 +29,6 @@ "${workspaceFolder}/demo" ], "outFiles": ["${workspaceFolder}/packages/vscode/built/**"], - "preLaunchTask": "npm: compile", "resolveSourceMapLocations": [ "${workspaceFolder}/**", "!**/node_modules/**" diff --git a/.vscode/settings.json b/.vscode/settings.json index be9832e451..53b780fa4a 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,8 +1,10 @@ { "devicescript.devtools.autoStart": false, "cSpell.words": [ + "accum", "adoinfo", "Agentic", + "AIAPI", "AIREQUEST", "ANYJS", "ANYTS", @@ -10,19 +12,29 @@ "argk", "argkv", "arrayify", + "astgrep", "astrojs", + "autocrop", "Automatable", + "autopad", "azurecontentsafety", + "azuredevops", "azureopenai", "azuretoken", "bitindex", "blockslist", + "bufferlike", + "BYOG", + "cancellers", "cctx", "changeext", + "chatencoder", + "chatrender", "chattypes", "Chunker", "chunkers", "cmds", + "cmsg", "codelion", "Codespaces", "codestral", @@ -35,10 +47,15 @@ "createfile", "cringy", "cybercrime", + "dall", "DALLE", "dbgc", + "dbgp", "dbgr", + "ddir", + "debugify", "deepseek", + "delurl", "demux", "devcontainers", "dfence", @@ -49,35 +66,50 @@ "domcontentloaded", "doptions", "dotjs", + "downsampled", "dtype", "eargs", "echomodel", "emojify", + "endgroup", "Entra", + "evalprompt", "Evals", "execa", + "extname", "fallbacktools", "fetchtext", + "ffprobe", "Fmepg", "frontmatter", + "fscache", + "FSTAR", + "fuzzsearch", + "gdir", "genai", "Genaiscript", + "genaiscriptdts", "GENAISCRIPTIGNORE", "genaisrc", "ghcliinfo", "ghinfo", "gistfs", "gistpad", + "githubclient", "gitmoji", + "greyscale", "GROQ", "Gruber", + "Halleux", "hostconfiguration", "hostpath", "htmlescape", "huggingface", "icontains", + "importprompt", "jaegertracing", "Jamba", + "jsonlinecache", "JSONLLM", "labeli", "labelledby", @@ -95,6 +127,7 @@ "logit", "Logprob", "logprobs", + "loremipsum", "lvce", "Maeda's", "makeitbetter", @@ -107,31 +140,40 @@ "memorystream", "menuitemcheckbox", "menuitemradio", + "micropip", "millis", "missings", "mixtral", "mkmd", + "modelalias", "modelcontextprotocol", "modelid", "murl", + "mydoc", "nameid", "namevalue", "napi", "nemo", "networkidle", + "newext", "nickyt", "nodehost", + "nodepackage", "nodir", "nomic", "nonemodel", "nothrow", + "oannotations", "ollama", "onnx", "openai", + "openaiapi", "OPENROUTER", "optillm", + "outf", "packagemanagers", "parameterquickpick", + "pdir", "Peli", "pelikhan", "pixtral", @@ -139,24 +181,32 @@ "previ", "PRICINGS", "priompt", + "promptcontext", "promptdom", "promptfoo", "promptfooconfig", "promptjson", "promptrunner", "prompty", + "proxify", "pyodide", "quoteify", "qwen", + "RAAA", "redteam", + "resd", "RIPGREP", "RULEID", + "runpromptcontext", "sarif", "SARIFF", + "scripters", "scriptid", "scriptquickpick", + "scriptresolver", "secretscanner", "sglang", + "shiki", "sidenote", "skia", "Smol", @@ -164,34 +214,48 @@ "smtlib", "socketserver", "spinbutton", + "sres", "stackgraph", "stackgraphs", + "stefanzweifel", "strcmp", "stringifying", "structurify", + "suffixext", "sysr", "tabletojson", "TAVILY", "templ", + "testhost", "Textify", "tlaplus", "tmpl", "tokenless", + "traceparser", "treegrid", "treesitter", "tvly", "typecheck", "unfence", + "unmarkdown", + "unsat", + "unthink", "unwrappers", "urllib", "urlparse", + "vectorsearch", "vectra", "venv", "vllm", + "vshost", "vsix", "waltoss", "wasms", + "websearch", + "WEBVTT", "whisperasr", + "wksrx", + "wsclient", "xpai", "Yohan" ], diff --git a/README.md b/README.md index c772e76a53..ab9f6f8a4b 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,7 @@ Programmatically assemble prompts for LLMs using JavaScript. Orchestrate LLMs, t - Built-in support for GitHub Copilot and GitHub Models, OpenAI, Azure OpenAI, Anthropic, and more - 📄 **Read the ONLINE DOCUMENTATION at [microsoft.github.io/genaiscript](https://microsoft.github.io/genaiscript/)** +- 💬 Join the [Discord server](https://discord.gg/y7HpumjHeB) - 📝 Read the [blog](https://microsoft.github.io/genaiscript/blog/) for the latest news - 📺 Watch [Mr. Maeda's Cozy AI Kitchen](https://youtu.be/ajEbAm6kjI4) - 📺 Watch an [interview on YouTube with nickyt](https://www.youtube.com/watch?v=aeXQ2MJ0Ye0) diff --git a/THIRD_PARTY_LICENSES.md b/THIRD_PARTY_LICENSES.md index de1081fb4d..b04ba967ff 100644 --- a/THIRD_PARTY_LICENSES.md +++ b/THIRD_PARTY_LICENSES.md @@ -192,7 +192,7 @@ The following npm packages may be included in this product: - @aws-crypto/supports-web-crypto@5.2.0 - @huggingface/transformers@3.4.0 - flatbuffers@25.2.10 - - long@5.3.1 + - long@5.3.2 These packages each contain the following license: @@ -1161,10 +1161,10 @@ Apache License The following npm packages may be included in this product: - @grpc/grpc-js@1.13.3 - - @grpc/proto-loader@0.7.13 - - detect-libc@2.0.3 + - @grpc/proto-loader@0.7.15 + - detect-libc@2.0.4 - docker-modem@5.0.6 - - dockerode@4.0.5 + - dockerode@4.0.6 These packages each contain the following license: @@ -1584,8 +1584,8 @@ Apache License The following npm packages may be included in this product: - - playwright-core@1.51.1 - - playwright@1.51.1 + - playwright-core@1.52.0 + - playwright@1.52.0 These packages each contain the following license: @@ -2018,12 +2018,12 @@ Apache License The following npm packages may be included in this product: - - @aws-sdk/client-cognito-identity@3.787.0 - - @aws-sdk/client-sso@3.787.0 - - @aws-sdk/credential-provider-cognito-identity@3.787.0 + - @aws-sdk/client-cognito-identity@3.796.0 + - @aws-sdk/client-sso@3.796.0 + - @aws-sdk/credential-provider-cognito-identity@3.796.0 - @aws-sdk/middleware-eventstream@3.775.0 - @aws-sdk/util-user-agent-browser@3.775.0 - - @aws-sdk/util-user-agent-node@3.787.0 + - @aws-sdk/util-user-agent-node@3.796.0 - @smithy/eventstream-codec@2.2.0 - @smithy/eventstream-codec@4.0.2 - @smithy/middleware-retry@4.1.0 @@ -2245,7 +2245,7 @@ Apache License The following npm package may be included in this product: - - @aws-sdk/client-bedrock-runtime@3.787.0 + - @aws-sdk/client-bedrock-runtime@3.796.0 This package contains the following license: @@ -2458,7 +2458,7 @@ The following npm packages may be included in this product: - @aws-sdk/eventstream-handler-node@3.775.0 - @aws-sdk/middleware-host-header@3.775.0 - @aws-sdk/middleware-recursion-detection@3.775.0 - - @aws-sdk/middleware-user-agent@3.787.0 + - @aws-sdk/middleware-user-agent@3.796.0 - @smithy/core@3.2.0 - @smithy/eventstream-serde-browser@4.0.2 - @smithy/eventstream-serde-config-resolver@4.1.0 @@ -2892,8 +2892,8 @@ The following npm packages may be included in this product: - @types/http-cache-semantics@4.0.4 - @types/node-fetch@2.6.12 - @types/node@16.9.1 - - @types/node@18.19.86 - - @types/node@22.14.1 + - @types/node@18.19.87 + - @types/node@22.15.2 - @types/sarif@2.1.7 - @types/turndown@5.0.5 - @types/uuid@9.0.8 @@ -2927,7 +2927,7 @@ MIT License The following npm package may be included in this product: - - genaiscript-vscode@1.129.1 + - genaiscript-vscode@1.131.0 This package contains the following license: @@ -4191,7 +4191,7 @@ software or this license, under any kind of legal claim._** The following npm package may be included in this product: - - axios@1.8.4 + - axios@1.9.0 This package contains the following license: @@ -4854,12 +4854,12 @@ Apache License The following npm packages may be included in this product: - - @aws-sdk/credential-provider-env@3.775.0 - - @aws-sdk/credential-provider-ini@3.787.0 - - @aws-sdk/credential-provider-node@3.787.0 - - @aws-sdk/credential-providers@3.787.0 + - @aws-sdk/credential-provider-env@3.796.0 + - @aws-sdk/credential-provider-ini@3.796.0 + - @aws-sdk/credential-provider-node@3.796.0 + - @aws-sdk/credential-providers@3.796.0 - @aws-sdk/region-config-resolver@3.775.0 - - @aws-sdk/token-providers@3.787.0 + - @aws-sdk/token-providers@3.796.0 - @aws-sdk/types@3.775.0 - @aws-sdk/util-endpoints@3.787.0 - @aws-sdk/util-locate-window@3.723.0 @@ -4886,7 +4886,7 @@ The following npm packages may be included in this product: - @smithy/shared-ini-file-loader@2.4.0 - @smithy/shared-ini-file-loader@4.0.2 - @smithy/signature-v4@3.1.2 - - @smithy/signature-v4@5.0.2 + - @smithy/signature-v4@5.1.0 - @smithy/util-base64@2.3.0 - @smithy/util-base64@4.0.0 - @smithy/util-body-length-browser@4.0.0 @@ -5114,9 +5114,9 @@ Apache License The following npm packages may be included in this product: - - @aws-sdk/credential-provider-process@3.775.0 - - @aws-sdk/credential-provider-sso@3.787.0 - - @aws-sdk/credential-provider-web-identity@3.787.0 + - @aws-sdk/credential-provider-process@3.796.0 + - @aws-sdk/credential-provider-sso@3.796.0 + - @aws-sdk/credential-provider-web-identity@3.796.0 These packages each contain the following license: @@ -6017,9 +6017,9 @@ END OF TERMS AND CONDITIONS The following npm packages may be included in this product: - - @aws-sdk/core@3.775.0 - - @aws-sdk/credential-provider-http@3.775.0 - - @aws-sdk/nested-clients@3.787.0 + - @aws-sdk/core@3.796.0 + - @aws-sdk/credential-provider-http@3.796.0 + - @aws-sdk/nested-clients@3.796.0 - pyodide@0.27.5 These packages each contain the following license: @@ -6584,9 +6584,7 @@ OTHER DEALINGS IN THE SOFTWARE. The following npm packages may be included in this product: - jwa@1.4.1 - - jwa@2.0.0 - jws@3.2.2 - - jws@4.0.0 These packages each contain the following license: @@ -6673,7 +6671,7 @@ The following npm packages may be included in this product: - parse5-htmlparser2-tree-adapter@7.1.0 - parse5-parser-stream@7.1.2 - - parse5@7.2.1 + - parse5@7.3.0 These packages each contain the following license: @@ -7307,10 +7305,10 @@ The following npm packages may be included in this product: - @inquirer/input@4.1.9 - @inquirer/number@3.0.12 - @inquirer/password@4.0.12 - - @inquirer/prompts@7.4.1 - - @inquirer/rawlist@4.0.12 + - @inquirer/prompts@7.5.0 + - @inquirer/rawlist@4.1.0 - @inquirer/search@3.0.12 - - @inquirer/select@4.1.1 + - @inquirer/select@4.2.0 - @inquirer/type@3.0.6 These packages each contain the following license: @@ -7349,6 +7347,7 @@ The following npm packages may be included in this product: - domhandler@5.0.3 - domutils@3.2.2 - entities@4.5.0 + - entities@6.0.0 - nth-check@2.1.1 These packages each contain the following license: @@ -7388,7 +7387,7 @@ The following npm packages may be included in this product: - @azure/core-client@1.9.3 - @azure/core-http-compat@2.2.0 - @azure/core-rest-pipeline@1.19.1 - - @azure/identity@4.8.0 + - @azure/identity@4.9.1 These packages each contain the following license: @@ -7835,8 +7834,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI The following npm packages may be included in this product: - - @anthropic-ai/bedrock-sdk@0.12.4 - - @anthropic-ai/sdk@0.39.0 + - @anthropic-ai/bedrock-sdk@0.12.5 + - @anthropic-ai/sdk@0.40.0 These packages each contain the following license: @@ -8893,16 +8892,16 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. The following npm packages may be included in this product: - - @esbuild/linux-x64@0.25.2 + - @esbuild/linux-x64@0.25.3 - @napi-rs/canvas-linux-x64-gnu@0.1.69 - @napi-rs/canvas-linux-x64-musl@0.1.69 - @tokenizer/token@0.3.0 - agent-base@6.0.2 - eastasianwidth@0.2.0 - - genaiscript-core-internal@1.129.1 - - genaiscript-sample@1.129.1 - - genaiscript-web@1.129.1 - - genaiscript@1.129.1 + - genaiscript-core-internal@1.131.0 + - genaiscript-sample@1.131.0 + - genaiscript-web@1.131.0 + - genaiscript@1.131.0 - https-proxy-agent@5.0.1 - isarray@1.0.0 - javascript-natural-sort@0.7.1 @@ -9651,7 +9650,7 @@ SOFTWARE. The following npm package may be included in this product: - - zod@3.24.2 + - zod@3.24.3 This package contains the following license: @@ -9681,7 +9680,7 @@ SOFTWARE. The following npm package may be included in this product: - - esbuild@0.25.2 + - esbuild@0.25.3 This package contains the following license: @@ -9771,7 +9770,7 @@ SOFTWARE. The following npm package may be included in this product: - - @azure/msal-node@3.5.0 + - @azure/msal-node@3.5.1 This package contains the following license: @@ -10314,7 +10313,7 @@ SOFTWARE. The following npm package may be included in this product: - - @modelcontextprotocol/sdk@1.9.0 + - @modelcontextprotocol/sdk@1.10.2 This package contains the following license: @@ -10445,6 +10444,7 @@ The following npm packages may be included in this product: - @ast-grep/lang-cpp@0.0.1 - @ast-grep/lang-csharp@0.0.1 - @ast-grep/lang-python@0.0.1 + - @ast-grep/lang-yaml@0.0.1 - @ast-grep/setup-lang@0.0.3 These packages each contain the following license: @@ -10743,8 +10743,8 @@ SOFTWARE. The following npm packages may be included in this product: - - @azure/msal-browser@4.10.0 - - @azure/msal-common@15.5.0 + - @azure/msal-browser@4.11.0 + - @azure/msal-common@15.5.1 These packages each contain the following license: @@ -11437,7 +11437,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. The following npm package may be included in this product: - - glob@11.0.1 + - glob@11.0.2 This package contains the following license: @@ -12962,36 +12962,6 @@ SOFTWARE. ----------- -The following npm package may be included in this product: - - - stoppable@1.1.0 - -This package contains the following license: - -The MIT License (MIT) - -Copyright (c) 2017 Hunter Loftis - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - ------------ - The following npm package may be included in this product: - node-gyp-build@4.8.4 @@ -13795,7 +13765,7 @@ For more information, please refer to The following npm package may be included in this product: - - protobufjs@7.4.0 + - protobufjs@7.5.0 This package contains the following license: diff --git a/demo/.vscode/settings.json b/demo/.vscode/settings.json index d44d91c5ff..628da8c109 100644 --- a/demo/.vscode/settings.json +++ b/demo/.vscode/settings.json @@ -1,4 +1,6 @@ { "cSpell.enabled": false, - "genaiscript.cli.path": "../packages/cli/built/genaiscript.cjs" + "genaiscript.cli.path": "../packages/cli/built/genaiscript.cjs", + "genaiscript.languageChatModels.preferred": true, + "genaiscript.languageChatModelsProvider": true } \ No newline at end of file diff --git a/demo/genaisrc/demo.code-workspace b/demo/genaisrc/demo.code-workspace new file mode 100644 index 0000000000..71373aa0de --- /dev/null +++ b/demo/genaisrc/demo.code-workspace @@ -0,0 +1,13 @@ +{ + "folders": [ + { + "path": ".." + }, + { + "path": "../../docs" + } + ], + "settings": { + "genaiscript.cli.path": "../packages/cli/built/genaiscript.cjs" + } +} \ No newline at end of file diff --git a/demo/genaisrc/haiku.genai.mts b/demo/genaisrc/haiku.genai.mts new file mode 100644 index 0000000000..f61c06f671 --- /dev/null +++ b/demo/genaisrc/haiku.genai.mts @@ -0,0 +1 @@ +$`Write a haiku about code` diff --git a/docs/astro.config.mjs b/docs/astro.config.mjs index 4cc2ea154b..b57638cb8e 100644 --- a/docs/astro.config.mjs +++ b/docs/astro.config.mjs @@ -108,6 +108,11 @@ is at https://microsoft.github.io/genaiscript/reference/scripts.md Footer: "./src/components/Footer.astro", }, social: [ + { + icon: "discord", + label: "Discord", + href: "https://discord.gg/y7HpumjHeB", + }, { icon: "github", label: "GitHub", diff --git a/docs/genaisrc/blog-image.genai.mts b/docs/genaisrc/blog-image.genai.mts index 71f2c6579e..c6b3971815 100644 --- a/docs/genaisrc/blog-image.genai.mts +++ b/docs/genaisrc/blog-image.genai.mts @@ -1,5 +1,5 @@ -script({ parameters: { force: false } }) -const file = env.files.find(({ filename }) => /\.mdx?$/.test(filename)) +script({ parameters: { force: false }, accept: ".md,.mdx" }) +const file = env.files[0] const target = path.changeext(file.filename, ".png") const fm = MD.frontmatter(file.content) @@ -10,7 +10,7 @@ if (env.vars.force || !(await workspace.stat(target))) { const { text: imagePrompt } = await runPrompt( (_) => { _.def("BLOG_POST", MD.content(file.content)) - _.$`Generate an image prompt for DALLE-3 that illustrates the contents of . + _.$`Generate an image prompt for gpt-image-1 that illustrates the contents of . Include specific description related to the content of . ${style}` }, @@ -24,10 +24,9 @@ Include specific description related to the content of . ${style}`, { mime: "image/png", - size: "1792x1024", - scale: 768 / 1792, + size: "landscape", maxHeight: 762, - style: "vivid", + model: "openai:gpt-image-1", } ) diff --git a/docs/genaisrc/blog-narration.genai.mts b/docs/genaisrc/blog-narration.genai.mts new file mode 100644 index 0000000000..43b709053b --- /dev/null +++ b/docs/genaisrc/blog-narration.genai.mts @@ -0,0 +1,142 @@ +script({ + title: "Blog Post Narrator", + description: "Creates narrated summaries of blog posts", + accept: ".mdx,.md", + model: "openai:gpt-4.1", + system: ["system.annotations"], + files: "docs/src/content/docs/blog/azure-ai-search.mdx", + parameters: { + force: false, + }, +}) +const { force } = env.vars +const file = env.files[0] +if (!file) cancel("No file provided") +// copy to assets +const targetName = path.basename(path.changeext(file.filename, ".mp3")) +const target = path.join(`./docs/public/blog`, targetName) +if (!force && (await workspace.stat(target))) + cancel(`File already exists: ${target}`) + +const examples = { + dramatic: `Voice Affect: Low, hushed, and suspenseful; convey tension and intrigue. + +Tone: Deeply serious and mysterious, maintaining an undercurrent of unease throughout. + +Pacing: Slow, deliberate, pausing slightly after suspenseful moments to heighten drama. + +Emotion: Restrained yet intense—voice should subtly tremble or tighten at key suspenseful points. + +Emphasis: Highlight sensory descriptions ("footsteps echoed," "heart hammering," "shadows melting into darkness") to amplify atmosphere. + +Pronunciation: Slightly elongated vowels and softened consonants for an eerie, haunting effect. + +Pauses: Insert meaningful pauses after phrases like "only shadows melting into darkness," and especially before the final line, to enhance suspense dramatically.`, + friendly: `Affect/personality: A cheerful guide + +Tone: Friendly, clear, and reassuring, creating a calm atmosphere and making the listener feel confident and comfortable. + +Pronunciation: Clear, articulate, and steady, ensuring each instruction is easily understood while maintaining a natural, conversational flow. + +Pause: Brief, purposeful pauses after key instructions (e.g., "cross the street" and "turn right") to allow time for the listener to process the information and follow along. + +Emotion: Warm and supportive, conveying empathy and care, ensuring the listener feels guided and safe throughout the journey.`, + ["eternal optimist"]: `Voice: Warm, upbeat, and reassuring, with a steady and confident cadence that keeps the conversation calm and productive. + +Tone: Positive and solution-oriented, always focusing on the next steps rather than dwelling on the problem. + +Dialect: Neutral and professional, avoiding overly casual speech but maintaining a friendly and approachable style. + +Pronunciation: Clear and precise, with a natural rhythm that emphasizes key words to instill confidence and keep the customer engaged. + +Features: Uses empathetic phrasing, gentle reassurance, and proactive language to shift the focus from frustration to resolution.`, + auctioneer: `Voice: Staccato, fast-paced, energetic, and rhythmic, with the classic charm of a seasoned auctioneer. + +Tone: Exciting, high-energy, and persuasive, creating urgency and anticipation. + +Delivery: Rapid-fire yet clear, with dynamic inflections to keep engagement high and momentum strong. + +Pronunciation: Crisp and precise, with emphasis on key action words like bid, buy, checkout, and sold to drive urgency.`, +} + +const { + json: { summary, instructions, voice }, +} = await runPrompt( + (_) => { + _.def("CONTENT", file) + _.$`You are a podcast writer. + + Your task is to create an engaging summary of this blog post that would work well as a narration + AND a voice description for a text-to-speech model AND a voice type. + + ## Summary Instructions + - Focus on the key points and main message + - Use natural, conversational language + - Keep it between 2-3 paragraphs + - You can use Technical Jargon, but explain it in simple terms + - Do not start with Excited + + ## Voice Instructions + - In your thinking, generate 5 descriptions of the voice suitable for a text-to-speech model. These voice personalities should be wildly different and esoteric. + - Include details about the accent, tone, pacing, emotion, pronunciation, and personality affect + - Get inspired by the content of the blog post + - Pick one of the 5 voices randomly as your output. + - go crazy on the voice descriptions + + Follow the structure of the following examples: + ${YAML.stringify(examples)} + + ## Voice Type + Select one of the voice types provided by OpenAI ("alloy" | "ash" | "coral" | "echo" | "fable" | "onyx" | "nova" | "sage" | "shimmer" | "verse" | "ballad") based on the blog post content + and the voice description you generated. + ` + }, + { + temperature: 1.1, + responseType: "json_schema", + responseSchema: { + instructions: { + required: true, + description: "voice description", + type: "string", + }, + voice: { + required: true, + type: "string", + enum: [ + "alloy", + "ash", + "coral", + "echo", + "fable", + "onyx", + "nova", + "sage", + "shimmer", + "verse", + "ballad", + ], + }, + summary: "summary", + }, + } +) + +if (!instructions) cancel("failed to generate instructions") + +// 3. Generate speech from the summary +const { filename } = await speak(summary, { + model: "openai:gpt-4o-mini-tts", // High quality speech model + voice, // Use a natural-sounding voice + instructions, +}) +if (!filename) cancel("failed to generate speech") +console.log(`audio file: ${filename}`) + +console.log(`target file: ${target}`) +await workspace.copyFile(filename, target) +await workspace.writeText(path.changeext(target, ".txt"), summary) +// convert to video +await host.exec( + `ffmpeg -loop 1 -i ${path.changeext(file.filename, ".png")} -i "${target}" -c:v libx264 -c:a copy -shortest "${path.changeext(target, ".mp4")}"` +) diff --git a/docs/genaisrc/docs-image.genai.mts b/docs/genaisrc/docs-image.genai.mts new file mode 100644 index 0000000000..03c4f9a409 --- /dev/null +++ b/docs/genaisrc/docs-image.genai.mts @@ -0,0 +1,60 @@ +script({ parameters: { force: false }, accept: ".md,.mdx" }) +const { force } = env.vars +const file = env.files[0] +const target = path.changeext(file.filename, ".png") +if (!force && (await workspace.stat(target))) + cancel("hero image already exists") + +const fm = MD.frontmatter(file.content) +// phase 1: generate image prompt +const style = + "iconic, 2D, 8-bit, corporate, 5-color, simple, geometric, 128x128. no people, no text, flat design, minimalistic, no background, no shadows, no gradients, no reflections, no 3D elements, no depth, no perspective, no realism, no photography, no realism, no photorealism" +const { text: imagePrompt } = await runPrompt( + (_) => { + _.def("CONTENT", MD.content(file.content)) + _.$`Generate an image prompt for DALLE-3 that illustrates the contents of . +Include specific description related to the content of . + ${style}` + }, + { responseType: "text", systemSafety: false } +) + +// phase 2: generate image +const image = await generateImage( + `${imagePrompt} + STYLE: + ${style}`, + { + mime: "image/png", + size: "1024x1024", + scale: 1, + maxHeight: 762, + style: "vivid", + autoCrop: true + } +) + +// phase 3: generate alt text +const { text: alt } = await prompt` +Generate an alt text description from . +Rephrase the prompt in a way that would be useful for someone who cannot see the image. +Do not start with "Alt Text:". + +IMAGE_PROMPT: +${imagePrompt}`.options({ + responseType: "text", + systemSafety: false, + label: "alt-text", +}) + +// phase 4: patch frontmatter +fm.hero = { + image: { + alt, + file: "./" + path.basename(target), + }, +} +await workspace.copyFile(image.image.filename, target) + +file.content = MD.updateFrontmatter(file.content, fm) +await workspace.writeFiles(file) diff --git a/docs/genaisrc/frontmatter.genai.mjs b/docs/genaisrc/frontmatter.genai.mjs deleted file mode 100644 index e7e5c26836..0000000000 --- a/docs/genaisrc/frontmatter.genai.mjs +++ /dev/null @@ -1,63 +0,0 @@ -script({ - model: "large", -}) - -// force refreshing all files -const force = env.vars.force - -// filter out files that don't have a front matter.description -const files = env.files - .filter((f) => /\.mdx?$/i.test(f.filename)) - .filter( - (f) => - force || - (!MD.frontmatter(f.content)?.description && - !f.content?.includes("autogenerated")) - ) -if (!files.length) cancel("no files to process") - -// insert markdown files in context -def("FILE", files) - -// prompt to generate front matter for markdown files -$`You are a search engine optimization expert at creating front matter for markdown document. - -For each FILE, re-generate the front matter content as the new file content. - -## Guidance - -- ONLY generate the front matter section. This is important. -- Update description as needed. -- Update keywords as needed, only 5 keywords or less. Use comma separated list for keywords. -- use yaml format, do not use quotes -- optimize for search engine optimization. -- If no front matter is present, generate it. - -## Things to avoid - -- DO NOT RESPOND the rest of the markdown content beyond the front matter. -- Do NOT modify the markdown content after the front matter -- Do NOT repeat project name (GenAIScript) in 'title' field -- DO NOT modify the existing 'title' or 'sidebar' fields. -- Do NOT use 'Guide' in title. -` - -// merge logic to integrate generated frontmatter fields -defFileOutput("**/*.{md,mdx}", "Updated markdown files") -defFileMerge((fn, label, before, generated) => { - if (!/\.mdx?$/i.test(fn)) return undefined - const frontmatter = MD.frontmatter(generated) - if (!frontmatter) { - console.log(`invalid syntax for generated frontmatter`) - return before - } - - const { title, description, keywords, tags } = frontmatter - const updated = MD.updateFrontmatter(before, { - title, - description, - keywords, - tags, - }) - return updated -}) diff --git a/docs/genaisrc/frontmatter.genai.mts b/docs/genaisrc/frontmatter.genai.mts new file mode 100644 index 0000000000..a17a8bdc18 --- /dev/null +++ b/docs/genaisrc/frontmatter.genai.mts @@ -0,0 +1,64 @@ +script({ + model: "large", + accept: ".md,.mdx", + parameters: { + force: false, + }, +}) + +// force refreshing all files +const { force, dbg } = env.vars + +// filter out files that don't have a front matter.description +const file = env.files[0] +const fm = MD.frontmatter(file.content) +if (!force && fm?.description) cancel("file already has description") +if (file.content?.includes("autogenerated")) cancel("file is autogenerated") + +// insert markdown files in context +const res = await runPrompt( + (ctx) => { + ctx.def("FILE", file) + + // prompt to generate front matter for markdown files + ctx.$`##Role + +You are a search engine optimization expert at creating front matter for markdown document. + +## Task + +Generate the front matter content as the new file content. + +## Guidance + +- Update description as needed. +- Update keywords as needed, only 5 keywords or less. +- optimize for search engine optimization. +- If no front matter is present, generate it. + +## Things to avoid + +- Do NOT repeat project name (GenAIScript) in 'title' field +- DO NOT modify the existing 'title' or 'sidebar' fields. +- Do NOT use 'Guide' in title. +` + }, + { + responseType: "json_schema", + responseSchema: { + title: "", + description: "", + keywords: [""], + }, + } +) + +const frontmatter = res.json +const { title, description, keywords, tags } = frontmatter +file.content = MD.updateFrontmatter(file.content, { + title, + description, + keywords, + tags, +}) +await workspace.writeFiles(file) diff --git a/docs/genaisrc/tsconfig.json b/docs/genaisrc/tsconfig.json index c092f18586..0abdb26cc2 100644 --- a/docs/genaisrc/tsconfig.json +++ b/docs/genaisrc/tsconfig.json @@ -17,9 +17,8 @@ "erasableSyntaxOnly": true }, "include": [ - "*.mjs", - "*.mts", - "src/*.mts", + "**/*.mjs", + "**/*.mts", "./genaiscript.d.ts" ] } \ No newline at end of file diff --git a/docs/package.json b/docs/package.json index 6b20605bee..dc0f663ace 100644 --- a/docs/package.json +++ b/docs/package.json @@ -2,7 +2,7 @@ "name": "docs", "type": "module", "private": true, - "version": "1.129.4", + "version": "1.132.0", "license": "MIT", "scripts": { "install:force": "rm yarn.lock && yarn install", @@ -20,15 +20,15 @@ }, "devDependencies": { "@astrojs/check": "^0.9.4", - "@astrojs/starlight": "^0.33.2", - "astro": "^5.7.0", + "@astrojs/starlight": "^0.34.0", + "astro": "^5.7.5", "astro-embed": "^0.9.0", "rehype-mermaid": "^3.0.0", - "starlight-blog": "^0.20.0", + "starlight-blog": "^0.21.0", "starlight-links-validator": "^0.16.0", "starlight-llms-txt": "^0.5.1", "starlight-package-managers": "^0.11.0", - "zx": "^8.5.2" + "zx": "^8.5.3" }, "resolutions": { "marked": "15.0.8" diff --git a/docs/public/blog/anthropic.mp3 b/docs/public/blog/anthropic.mp3 new file mode 100644 index 0000000000..0e6d1c3908 Binary files /dev/null and b/docs/public/blog/anthropic.mp3 differ diff --git a/docs/public/blog/ast-grep-and-transform.mp3 b/docs/public/blog/ast-grep-and-transform.mp3 new file mode 100644 index 0000000000..7bbe13902c Binary files /dev/null and b/docs/public/blog/ast-grep-and-transform.mp3 differ diff --git a/docs/public/blog/automatic-web-page-content-analysis-with-genaiscript-.mp3 b/docs/public/blog/automatic-web-page-content-analysis-with-genaiscript-.mp3 new file mode 100644 index 0000000000..ce88349948 Binary files /dev/null and b/docs/public/blog/automatic-web-page-content-analysis-with-genaiscript-.mp3 differ diff --git a/docs/public/blog/azure-ai-search.mp3 b/docs/public/blog/azure-ai-search.mp3 new file mode 100644 index 0000000000..3ad3ad9296 Binary files /dev/null and b/docs/public/blog/azure-ai-search.mp3 differ diff --git a/docs/public/blog/blog-images.mp3 b/docs/public/blog/blog-images.mp3 new file mode 100644 index 0000000000..cce6012241 Binary files /dev/null and b/docs/public/blog/blog-images.mp3 differ diff --git a/docs/public/blog/blog-narration.mp3 b/docs/public/blog/blog-narration.mp3 new file mode 100644 index 0000000000..18ff38b15f Binary files /dev/null and b/docs/public/blog/blog-narration.mp3 differ diff --git a/docs/public/blog/creating-release-notes-with-genai.mp3 b/docs/public/blog/creating-release-notes-with-genai.mp3 new file mode 100644 index 0000000000..886e9352e2 Binary files /dev/null and b/docs/public/blog/creating-release-notes-with-genai.mp3 differ diff --git a/docs/public/blog/discord.mp3 b/docs/public/blog/discord.mp3 new file mode 100644 index 0000000000..5909f91b64 Binary files /dev/null and b/docs/public/blog/discord.mp3 differ diff --git a/docs/public/blog/discord.txt b/docs/public/blog/discord.txt new file mode 100644 index 0000000000..2ef1ef3e0e --- /dev/null +++ b/docs/public/blog/discord.txt @@ -0,0 +1,3 @@ +Want a place to geek out about your latest AI script or swap ideas with fellow scripters? Check out the GenAIScript Discord server—a lively community where you can share your wildest projects, get answers to technical questions, and collaborate on all things scripting. Whether you’re a beginner or a seasoned pro, you’ll find channels for problem-solving, feedback, and project showcases, all connected by a shared passion for advancing creative scripting using AI tools. + +Just hop on to get support, brainstorm script logic, or simply connect with others who speak your tech language. The invite link is open—come join and help shape the next wave of GenAIScript innovation! \ No newline at end of file diff --git a/docs/public/blog/fallback-tools.mp3 b/docs/public/blog/fallback-tools.mp3 new file mode 100644 index 0000000000..4eb1dcd246 Binary files /dev/null and b/docs/public/blog/fallback-tools.mp3 differ diff --git a/docs/public/blog/gentle-introduction-to-genaiscript.mp3 b/docs/public/blog/gentle-introduction-to-genaiscript.mp3 new file mode 100644 index 0000000000..a4cb61c43d Binary files /dev/null and b/docs/public/blog/gentle-introduction-to-genaiscript.mp3 differ diff --git a/docs/public/blog/gists.mp3 b/docs/public/blog/gists.mp3 new file mode 100644 index 0000000000..18ab2be3ea Binary files /dev/null and b/docs/public/blog/gists.mp3 differ diff --git a/docs/public/blog/github-models-in-github-actions.mp3 b/docs/public/blog/github-models-in-github-actions.mp3 new file mode 100644 index 0000000000..d570c70cf9 Binary files /dev/null and b/docs/public/blog/github-models-in-github-actions.mp3 differ diff --git a/docs/public/blog/gpt-image-1.mp3 b/docs/public/blog/gpt-image-1.mp3 new file mode 100644 index 0000000000..3a0d355d79 Binary files /dev/null and b/docs/public/blog/gpt-image-1.mp3 differ diff --git a/docs/public/blog/gpt-image-1.txt b/docs/public/blog/gpt-image-1.txt new file mode 100644 index 0000000000..9ece4c104e --- /dev/null +++ b/docs/public/blog/gpt-image-1.txt @@ -0,0 +1 @@ +OpenAI just introduced gpt-image-1, the latest AI model designed to generate images from plain text prompts. This update is now available through both OpenAI’s own API and Azure AI Foundry, making it even easier for anyone to experiment with image generation. To test its abilities, the team generated pixel art cats with the same prompt across three models—DALL·E 2, DALL·E 3, and gpt-image-1—highlighting how each interprets the same creative task. The results show different visual styles and a unique flair from the new gpt-image-1, which brings fresh options for creators seeking distinctive, high-detail pixel art. With this launch, you can now compare outputs side by side, observing nuanced changes in how these models translate words into images—and discover which one fits your next idea best. \ No newline at end of file diff --git a/docs/public/blog/hugging-face-transformers.mp3 b/docs/public/blog/hugging-face-transformers.mp3 new file mode 100644 index 0000000000..bed45f1e47 Binary files /dev/null and b/docs/public/blog/hugging-face-transformers.mp3 differ diff --git a/docs/public/blog/llm-agents.mp3 b/docs/public/blog/llm-agents.mp3 new file mode 100644 index 0000000000..20907b6860 Binary files /dev/null and b/docs/public/blog/llm-agents.mp3 differ diff --git a/docs/public/blog/makeitbetter.mp3 b/docs/public/blog/makeitbetter.mp3 new file mode 100644 index 0000000000..abc3c89cdd Binary files /dev/null and b/docs/public/blog/makeitbetter.mp3 differ diff --git a/docs/public/blog/mcp-agents.mp3 b/docs/public/blog/mcp-agents.mp3 new file mode 100644 index 0000000000..d1d7293b77 Binary files /dev/null and b/docs/public/blog/mcp-agents.mp3 differ diff --git a/docs/public/blog/mcp-intents.mp3 b/docs/public/blog/mcp-intents.mp3 new file mode 100644 index 0000000000..14b256a9a2 Binary files /dev/null and b/docs/public/blog/mcp-intents.mp3 differ diff --git a/docs/public/blog/mcp-resources.mp3 b/docs/public/blog/mcp-resources.mp3 new file mode 100644 index 0000000000..347e90f946 Binary files /dev/null and b/docs/public/blog/mcp-resources.mp3 differ diff --git a/docs/public/blog/mcp-tool-validation.mp3 b/docs/public/blog/mcp-tool-validation.mp3 new file mode 100644 index 0000000000..3d9c241f1d Binary files /dev/null and b/docs/public/blog/mcp-tool-validation.mp3 differ diff --git a/docs/public/blog/node-api.mp3 b/docs/public/blog/node-api.mp3 new file mode 100644 index 0000000000..6062c3b44d Binary files /dev/null and b/docs/public/blog/node-api.mp3 differ diff --git a/docs/public/blog/playground.mp3 b/docs/public/blog/playground.mp3 new file mode 100644 index 0000000000..e0012d317c Binary files /dev/null and b/docs/public/blog/playground.mp3 differ diff --git a/docs/public/blog/prompting-is-the-new-scripting.mp3 b/docs/public/blog/prompting-is-the-new-scripting.mp3 new file mode 100644 index 0000000000..73ac871f36 Binary files /dev/null and b/docs/public/blog/prompting-is-the-new-scripting.mp3 differ diff --git a/docs/public/blog/readme-maintenance.mp3 b/docs/public/blog/readme-maintenance.mp3 new file mode 100644 index 0000000000..b50cb6afea Binary files /dev/null and b/docs/public/blog/readme-maintenance.mp3 differ diff --git a/docs/public/blog/scripts-as-mcp-tools.mp3 b/docs/public/blog/scripts-as-mcp-tools.mp3 new file mode 100644 index 0000000000..545ffe853c Binary files /dev/null and b/docs/public/blog/scripts-as-mcp-tools.mp3 differ diff --git a/docs/public/blog/search-transform-genai.mp3 b/docs/public/blog/search-transform-genai.mp3 new file mode 100644 index 0000000000..ea21cfa961 Binary files /dev/null and b/docs/public/blog/search-transform-genai.mp3 differ diff --git a/docs/public/blog/super-charge-copilot-chat.mp3 b/docs/public/blog/super-charge-copilot-chat.mp3 new file mode 100644 index 0000000000..7a83614b0a Binary files /dev/null and b/docs/public/blog/super-charge-copilot-chat.mp3 differ diff --git a/docs/public/blog/support-for-agentic-tools.mp3 b/docs/public/blog/support-for-agentic-tools.mp3 new file mode 100644 index 0000000000..58dba3f0fa Binary files /dev/null and b/docs/public/blog/support-for-agentic-tools.mp3 differ diff --git a/docs/public/blog/video-introduction.mp3 b/docs/public/blog/video-introduction.mp3 new file mode 100644 index 0000000000..68192302ad Binary files /dev/null and b/docs/public/blog/video-introduction.mp3 differ diff --git a/docs/public/blog/video.mp3 b/docs/public/blog/video.mp3 new file mode 100644 index 0000000000..23d209b867 Binary files /dev/null and b/docs/public/blog/video.mp3 differ diff --git a/docs/public/blog/we-have-a-podcast.mp3 b/docs/public/blog/we-have-a-podcast.mp3 new file mode 100644 index 0000000000..3f3ec4f615 Binary files /dev/null and b/docs/public/blog/we-have-a-podcast.mp3 differ diff --git a/docs/public/blog/webview.mp3 b/docs/public/blog/webview.mp3 new file mode 100644 index 0000000000..91407e6751 Binary files /dev/null and b/docs/public/blog/webview.mp3 differ diff --git a/docs/src/components/AudioPlayer.astro b/docs/src/components/AudioPlayer.astro index e03f5b4c2c..db564ab97d 100644 --- a/docs/src/components/AudioPlayer.astro +++ b/docs/src/components/AudioPlayer.astro @@ -1,13 +1,22 @@ --- +import * as path from "path" interface Props { src: string + aiDisclaimer?: boolean } -const { src } = Astro.props +const { src, aiDisclaimer } = Astro.props +const mime = `audio/` + path.extname(src).slice(1) +const title = aiDisclaimer + ? `Generated by 🤖 AI with random voice personality. Content interpretation may vary.` + : undefined ---
-
\ No newline at end of file +
+ {aiDisclaimer ? `Generated by 🤖 AI` : null} +
+ diff --git a/docs/src/components/BlogNarration.astro b/docs/src/components/BlogNarration.astro new file mode 100644 index 0000000000..3391de264f --- /dev/null +++ b/docs/src/components/BlogNarration.astro @@ -0,0 +1,10 @@ +--- +import AudioPlayer from "./AudioPlayer.astro" + +interface Props {} + +const { url } = Astro +const audioUrl = url.href.replace(/\/$/, "") + ".mp3" +--- + + diff --git a/docs/src/components/BuiltinAgents.mdx b/docs/src/components/BuiltinAgents.mdx index 97909bc3c3..76c071bfa5 100644 --- a/docs/src/components/BuiltinAgents.mdx +++ b/docs/src/components/BuiltinAgents.mdx @@ -16,4 +16,4 @@ import { LinkCard } from '@astrojs/starlight/components'; - + diff --git a/docs/src/components/BuiltinTools.mdx b/docs/src/components/BuiltinTools.mdx index dd26159003..d5edc9ccef 100644 --- a/docs/src/components/BuiltinTools.mdx +++ b/docs/src/components/BuiltinTools.mdx @@ -6,6 +6,7 @@ import { LinkCard } from '@astrojs/starlight/components'; ### Builtin tools + diff --git a/docs/src/components/Head.astro b/docs/src/components/Head.astro index 7dba39f29f..b52352e8bc 100644 --- a/docs/src/components/Head.astro +++ b/docs/src/components/Head.astro @@ -1,6 +1,9 @@ --- import Default from "@astrojs/starlight/components/Head.astro" +import type { ImageMetadata } from "astro" +import { getImage } from "astro:assets" +const url = Astro.url const canonical = Astro.site ? new URL(Astro.url.pathname, Astro.site) : undefined @@ -8,6 +11,15 @@ const llms = Astro.site ? new URL("/genaiscript/llms.txt", Astro.site) : undefined const slug = canonical?.href.replace(/\/$/, "") + ".md" +const { data } = Astro.locals.starlightRoute.entry +const image: ImageMetadata | undefined = ( + data.hero?.image as { file?: ImageMetadata } +)?.file +const ogImage = image + ? await getImage({ + src: image, + }) + : undefined --- @@ -15,3 +27,4 @@ const slug = canonical?.href.replace(/\/$/, "") + ".md" +{ogImage ? : null} diff --git a/docs/src/content/docs/blog/88daddda0cbe49a60fe7b11db44b2f037c0e70f8469884df13e0bbaff8bb66de.png b/docs/src/content/docs/blog/88daddda0cbe49a60fe7b11db44b2f037c0e70f8469884df13e0bbaff8bb66de.png new file mode 100644 index 0000000000..187265e7bd Binary files /dev/null and b/docs/src/content/docs/blog/88daddda0cbe49a60fe7b11db44b2f037c0e70f8469884df13e0bbaff8bb66de.png differ diff --git a/docs/src/content/docs/blog/8ce06ae2b0bd7193701d7914faf3faf9b384ae6d3d8cb1d29113b47900aad66a.png b/docs/src/content/docs/blog/8ce06ae2b0bd7193701d7914faf3faf9b384ae6d3d8cb1d29113b47900aad66a.png new file mode 100644 index 0000000000..df29cafbd1 Binary files /dev/null and b/docs/src/content/docs/blog/8ce06ae2b0bd7193701d7914faf3faf9b384ae6d3d8cb1d29113b47900aad66a.png differ diff --git a/docs/src/content/docs/blog/9c8d4a6bd2b023110b8e716ca48acae431401adf1c8d816c9b986abefa6acafe.png b/docs/src/content/docs/blog/9c8d4a6bd2b023110b8e716ca48acae431401adf1c8d816c9b986abefa6acafe.png new file mode 100644 index 0000000000..a2c911f1a4 Binary files /dev/null and b/docs/src/content/docs/blog/9c8d4a6bd2b023110b8e716ca48acae431401adf1c8d816c9b986abefa6acafe.png differ diff --git a/docs/src/content/docs/blog/anthropic.md b/docs/src/content/docs/blog/anthropic.md deleted file mode 100644 index f3e55c78f9..0000000000 --- a/docs/src/content/docs/blog/anthropic.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -title: Anthropic Models -date: 2024-10-22 -authors: genaiscript -tags: - - anthropic -canonical_url: https://microsoft.github.io/genaiscript/blog/anthropic -description: Support for Claude. -cover: - alt: A stylized 8-bit image depicts a geometric computer screen with pixelated - icons representing GitHub and Microsoft logos. These icons are connected - through a network diagram, illustrating digital collaboration. The image - uses a limited palette of five corporate colors to emphasize the theme of - teamwork in code contribution. The background remains simple to focus - attention on the depicted network connections. - image: ./anthropic.png -excerpt: The Anthropic model integration is now supported, thanks to - contributions from [@waltoss](https://github.com/waltoss). While a few tasks - remain, the groundwork is solid. For guidance on configuring the model, check - the - [documentation](https://microsoft.github.io/genaiscript/getting-started/configuration/#anthropic). - Open discussions on next steps are ongoing - [here](https://github.com/microsoft/genaiscript/discussions/790). - ---- - -Big thanks to [@waltoss](https://github.com/waltoss) who contributed the [Anthropic model](https://github.com/microsoft/genaiscript/pull/788) support. There are still some [TODOs](https://github.com/microsoft/genaiscript/discussions/790) but the basics are in place. - -- [documentation](https://microsoft.github.io/genaiscript/getting-started/configuration/#anthropic) diff --git a/docs/src/content/docs/blog/anthropic.mdx b/docs/src/content/docs/blog/anthropic.mdx new file mode 100644 index 0000000000..3c9bdf76f6 --- /dev/null +++ b/docs/src/content/docs/blog/anthropic.mdx @@ -0,0 +1,33 @@ +--- +title: Anthropic Models +date: 2024-10-22 +authors: genaiscript +tags: + - anthropic +canonical_url: https://microsoft.github.io/genaiscript/blog/anthropic +description: Support for Claude. +cover: + alt: + A stylized 8-bit image depicts a geometric computer screen with pixelated + icons representing GitHub and Microsoft logos. These icons are connected + through a network diagram, illustrating digital collaboration. The image + uses a limited palette of five corporate colors to emphasize the theme of + teamwork in code contribution. The background remains simple to focus + attention on the depicted network connections. + image: ./anthropic.png +excerpt: The Anthropic model integration is now supported, thanks to + contributions from [@waltoss](https://github.com/waltoss). While a few tasks + remain, the groundwork is solid. For guidance on configuring the model, check + the + [documentation](https://microsoft.github.io/genaiscript/getting-started/configuration/#anthropic). + Open discussions on next steps are ongoing + [here](https://github.com/microsoft/genaiscript/discussions/790). +--- + +import BlogNarration from "../../../components/BlogNarration.astro" + + + +Big thanks to [@waltoss](https://github.com/waltoss) who contributed the [Anthropic model](https://github.com/microsoft/genaiscript/pull/788) support. There are still some [TODOs](https://github.com/microsoft/genaiscript/discussions/790) but the basics are in place. + +- [documentation](https://microsoft.github.io/genaiscript/getting-started/configuration/#anthropic) diff --git a/docs/src/content/docs/blog/anthropic.png b/docs/src/content/docs/blog/anthropic.png index 88a0c7cc6e..0b33e843a2 100644 Binary files a/docs/src/content/docs/blog/anthropic.png and b/docs/src/content/docs/blog/anthropic.png differ diff --git a/docs/src/content/docs/blog/ast-grep-and-transform.mdx b/docs/src/content/docs/blog/ast-grep-and-transform.mdx index 0c37d5fd3d..84173ace3e 100644 --- a/docs/src/content/docs/blog/ast-grep-and-transform.mdx +++ b/docs/src/content/docs/blog/ast-grep-and-transform.mdx @@ -30,6 +30,9 @@ excerpt: Automating code updates at scale can be tricky, especially when it import { Code } from "@astrojs/starlight/components" import code from "../../../../../genaisrc/docs.genai.mjs?raw" +import BlogNarration from "../../../components/BlogNarration.astro" + + This page describes a strategy to build GenAI scripts that use Abstract Syntax Trees (AST) to parse and modify source code. When applicable, it provides an extremely flexible and stable way to diff --git a/docs/src/content/docs/blog/ast-grep-and-transform.png b/docs/src/content/docs/blog/ast-grep-and-transform.png index 55ab07587f..ca3517407a 100644 Binary files a/docs/src/content/docs/blog/ast-grep-and-transform.png and b/docs/src/content/docs/blog/ast-grep-and-transform.png differ diff --git a/docs/src/content/docs/blog/automatic-web-page-content-analysis-with-genaiscript-.md b/docs/src/content/docs/blog/automatic-web-page-content-analysis-with-genaiscript-.mdx similarity index 97% rename from docs/src/content/docs/blog/automatic-web-page-content-analysis-with-genaiscript-.md rename to docs/src/content/docs/blog/automatic-web-page-content-analysis-with-genaiscript-.mdx index 6c65ab2144..3a1168986b 100644 --- a/docs/src/content/docs/blog/automatic-web-page-content-analysis-with-genaiscript-.md +++ b/docs/src/content/docs/blog/automatic-web-page-content-analysis-with-genaiscript-.mdx @@ -25,6 +25,10 @@ excerpt: Automating web page content analysis is simplified with GenAIScript and --- +import BlogNarration from "../../../components/BlogNarration.astro" + + + In this blog post, we'll dive into a practical example showcasing how to leverage GenAIScript for automatic web page content analysis. GenAIScript uses the [playwright](https://playwright.dev/) browser automation library which allows to load, interact and inspect web pages. ### Step-by-Step Explanation of the Code diff --git a/docs/src/content/docs/blog/automatic-web-page-content-analysis-with-genaiscript-.png b/docs/src/content/docs/blog/automatic-web-page-content-analysis-with-genaiscript-.png index 1f3b4cc0e9..a3c47e4365 100644 Binary files a/docs/src/content/docs/blog/automatic-web-page-content-analysis-with-genaiscript-.png and b/docs/src/content/docs/blog/automatic-web-page-content-analysis-with-genaiscript-.png differ diff --git a/docs/src/content/docs/blog/azure-ai-search.mdx b/docs/src/content/docs/blog/azure-ai-search.mdx index cfcbea6342..b740fcf970 100644 --- a/docs/src/content/docs/blog/azure-ai-search.mdx +++ b/docs/src/content/docs/blog/azure-ai-search.mdx @@ -27,6 +27,10 @@ excerpt: Discover how GenAIScript simplifies interaction with Azure AI Search --- +import BlogNarration from "../../../components/BlogNarration.astro" + + + The `retrieval` APIs has been extended to support [Azure AI Search](https://learn.microsoft.com/en-us/azure/search/search-what-is-azure-search). This allows you to index files using embeddings into a vector database that can be used for similarity search. This is commonly referred to as Retrieval Augmented Generation (RAG). @@ -42,7 +46,7 @@ def("RAG", res) ``` GenAIScript provides a simple and efficient way to interact with Azure AI Search. It will handle -chunking, vecorization, and indexing of the files. The `retrieval.index` function creates an index +chunking, vectorization, and indexing of the files. The `retrieval.index` function creates an index with the specified name and type. The `insertOrUpdate` function indexes the files into the database. Finally, the `search` function retrieves the files that match the query. diff --git a/docs/src/content/docs/blog/azure-ai-search.png b/docs/src/content/docs/blog/azure-ai-search.png index db694f7526..3306098bc7 100644 Binary files a/docs/src/content/docs/blog/azure-ai-search.png and b/docs/src/content/docs/blog/azure-ai-search.png differ diff --git a/docs/src/content/docs/blog/blog-images.mdx b/docs/src/content/docs/blog/blog-images.mdx index c36b4ddea2..e53a81c533 100644 --- a/docs/src/content/docs/blog/blog-images.mdx +++ b/docs/src/content/docs/blog/blog-images.mdx @@ -31,6 +31,10 @@ excerpt: Automatically generating blog post cover images may sound mundane, but import { Code } from "@astrojs/starlight/components" import code from "../../../../genaisrc/blog-image.genai.mts?raw" +import BlogNarration from "../../../components/BlogNarration.astro" + + + We generate cover images to the blog, this in itself is completely uninteresting... but the script that generated the images is worth a look. diff --git a/docs/src/content/docs/blog/blog-images.png b/docs/src/content/docs/blog/blog-images.png index 3c059e9f98..d6ae884448 100644 Binary files a/docs/src/content/docs/blog/blog-images.png and b/docs/src/content/docs/blog/blog-images.png differ diff --git a/docs/src/content/docs/blog/blog-narration.mdx b/docs/src/content/docs/blog/blog-narration.mdx new file mode 100644 index 0000000000..86514e3781 --- /dev/null +++ b/docs/src/content/docs/blog/blog-narration.mdx @@ -0,0 +1,181 @@ +--- +title: Blog Narration +authors: + - genaiscript + - pelikhan +date: 2025-04-17 +tags: + - blog + - summary + - voice + - narration + - ai +canonical_url: https://microsoft.github.io/genaiscript/blog/blog-narration +cover: + alt: "A clean, corporate workspace scene showing a stylized open laptop on a + desk. From the laptop’s screen, a colorful geometric blog post splits into + two paths: one morphs into a text document symbol and the other into a bold, + wavy audio waveform. Clear, simple arrows and icons show the transformation, + with shapes hinting at narration, AI, and summarization, all rendered in + 8-bit style with a striking five-color palette. No people, text, or clutter + are present." + image: ./blog-narration.png +excerpt: Transform your blog workflow with AI-driven narration and + summarization. This solution takes your markdown files, creates a concise + summary, and generates an audio narration using advanced text-to-speech + models. The script reads blog content, prompts an AI to extract key points, + and designs a tailored voice profile for text-to-speech. It incorporates + checks to prevent overwriting files and uses sample voice personalities to + guide the narration. By integrating functions like runPrompt and speak, you + can turn written posts into engaging audio content, broadening accessibility + and reach for your audience. + +--- +import BlogNarration from "../../../components/BlogNarration.astro" + + + +Ever wanted an easy way to create a summary and a spoken narration for your blog post? +This script helps you do that using AI, turning your blog content into both a text summary and a voice audio file. +[See the source on GitHub.](https://github.com/microsoft/genaiscript/blob/main/docs/genaisrc/blog-narration.genai.mts) + +## How the Script Works + +Let's go through the script step by step, explaining what each part does. + +```ts +script({ + title: "Blog Post Narrator", + description: "Creates narrated summaries of blog posts", + accept: ".mdx,.md", + model: "large", + system: ["system.annotations"], + files: "docs/src/content/docs/blog/azure-ai-search.mdx", + parameters: { + force: false, + }, +}) +``` + +- defines the script metadata: title, description, which file types it processes (`.mdx`, `.md`), and which AI model to use. +- `"files"` points to the sample blog post to be narrated. +- `"parameters"` set optional script flags. + +```ts +const { force } = env.vars +const file = env.files[0] +if (!file) cancel("No file provided") +``` + +- reads input parameters from environment variables and files. +- If no file is provided, the script cancels immediately. + +```ts +const targetName = path.basename(path.changeext(file.filename, ".mp3")) +const target = path.join(`./docs/public/blog`, targetName) +if (!force && (await workspace.stat(target))) { + cancel(`File already exists: ${target}`) +} +``` + +- prepares the name and target location for the output `.mp3` audio file. +- If the file already exists and `force` is not set, the script cancels. + +```ts +const examples = { + dramatic: `Voice Affect: Low, hushed, and suspenseful; convey tension and intrigue....`, + friendly: `Affect/personality: A cheerful guide...`, ... +} +``` + +- prepares various sample voice and narration styles as guidance for the model. + +```ts +const { + json: { summary, instructions, voice }, +} = await runPrompt( + (_) => { + _.def("CONTENT", file) + _.`You are a podcast writer. + +Your task is to create an engaging summary of this blog post that would work well as a narration +AND a voice description for a text-to-speech model AND a voice type. + +## Summary Instructions + - Focus on the key points and main message + - Use natural, conversational language + - Keep it between 2-3 paragraphs + - You can use Technical Jargon, but explain it in simple terms + - Do not start with Excited + +## Voice Instructions + - In your thinking, generate 5 descriptions of the voice suitable for a text-to-speech model. These voice personalities should be wildly different and esoteric. + - Include details about the accent, tone, pacing, emotion, pronunciation, and personality affect + - Get inspired by the content of the blog post + - Pick one of the 5 voices randomly as your output. + - go crazy on the voice descriptions + + Follow the structure of the following examples: + ${YAML.stringify(examples)} + + ## Voice Type + Select one of the voice types provided by OpenAI ("alloy" | "ash" | "coral" | "echo" | "fable" | "onyx" | "nova" | "sage" | "shimmer" | "verse" | "ballad") based on the blog post content + and the voice description you generated. + ` + }, + { + temperature: 1.1, + responseType: "json_schema", + responseSchema: { + instructions: "voice description", + voice: { + required: true, + type: "string", + enum: [ + "alloy", "ash", "coral", "echo", "fable", "onyx", "nova", "sage", "shimmer", "verse", "ballad", + ], + }, + summary: "summary", + }, + } +) +``` + +- Runs an AI-powered prompt to generate: + - A summary of the blog post + - A narration style description + - A voice type (from OpenAI TTS voices) +- The prompt details every requirement for the AI model, including instructions and example outputs. + +```ts +const { filename } = await speak(summary, { + model: "openai:gpt-4o-mini-tts", // High quality speech model + voice, // Use a natural-sounding voice + instructions, +}) +``` + +- Calls the `speak` function to generate an audio narration of the summary using the chosen voice type and narration style. + +```ts +if (!filename) cancel("failed to generate speech") +console.log(`audio file: ${filename}`) +``` + +- If audio file generation fails, the script stops. +- Otherwise, logs the output audio file name. + +## Imported Functions + +This script uses helpers from `genaiscript/runtime`: + +- `runPrompt` - sends prompts to the AI model and returns structured outputs. +- `speak` - generates audio narration from text and voice instructions. +- `workspace` - handles file operations safely. +- `host.exec` - runs shell commands (like `ffmpeg`) to process files. + +You can [browse the runtime source here](https://github.com/microsoft/genaiscript/blob/main/packages/cli/src/runtime.ts). + +## Summary + +This script quickly turns any blog post into a summarized text and voice narration, ready to share as audio or video. Perfect for making your blog more accessible and engaging! 🎤📝 diff --git a/docs/src/content/docs/blog/blog-narration.png b/docs/src/content/docs/blog/blog-narration.png new file mode 100644 index 0000000000..860ce44597 Binary files /dev/null and b/docs/src/content/docs/blog/blog-narration.png differ diff --git a/docs/src/content/docs/blog/creating-release-notes-with-genai.md b/docs/src/content/docs/blog/creating-release-notes-with-genai.mdx similarity index 92% rename from docs/src/content/docs/blog/creating-release-notes-with-genai.md rename to docs/src/content/docs/blog/creating-release-notes-with-genai.mdx index a52ff56bc2..8d5d7379be 100644 --- a/docs/src/content/docs/blog/creating-release-notes-with-genai.md +++ b/docs/src/content/docs/blog/creating-release-notes-with-genai.mdx @@ -30,7 +30,9 @@ excerpt: Crafting effective release notes can be a time-consuming process, but --- -## Automating Your Release Notes with GenAI +import BlogNarration from "../../../components/BlogNarration.astro" + + Bringing a new version of a product into the world is always exciting! But alongside the thrill comes the duty of informing users about what's changed. That's where generating crisp, engaging release notes comes into play. ✨ @@ -75,8 +77,9 @@ We are reading the current version from `package.json` and using Git to find the #### Step 4: Gathering Commits ```javascript -const { stdout: commits } = await host.exec(`git log --grep='skip ci' --invert-grep --no-merges HEAD...${tag}`) - +const { stdout: commits } = await host.exec( + `git log --grep='skip ci' --invert-grep --no-merges HEAD...${tag}` +) ``` This block runs a Git command to retrieve the list of commits that will be included in the release notes, excluding any with 'skip ci' in the message. @@ -84,8 +87,9 @@ This block runs a Git command to retrieve the list of commits that will be inclu #### Step 5: Obtaining the Diff ```javascript -const { stdout: diff } = await host.exec(`git diff ${tag}..HEAD --no-merges -- ':!**/package.json' ':!**/genaiscript.d.ts' ':!**/jsconfig.json' ':!docs/**' ':!.github/*' ':!.vscode/*' ':!*yarn.lock' ':!*THIRD_PARTY_NOTICES.md'`) - +const { stdout: diff } = await host.exec( + `git diff ${tag}..HEAD --no-merges -- ':!**/package.json' ':!**/genaiscript.d.ts' ':!**/jsconfig.json' ':!docs/**' ':!.github/*' ':!.vscode/*' ':!*yarn.lock' ':!*THIRD_PARTY_NOTICES.md'` +) ``` Next, we get the diff of changes since the last release, excluding certain files and directories that aren't relevant to the user-facing release notes. diff --git a/docs/src/content/docs/blog/creating-release-notes-with-genai.png b/docs/src/content/docs/blog/creating-release-notes-with-genai.png index 88990ce20a..4bb51d885d 100644 Binary files a/docs/src/content/docs/blog/creating-release-notes-with-genai.png and b/docs/src/content/docs/blog/creating-release-notes-with-genai.png differ diff --git a/docs/src/content/docs/blog/discord.mdx b/docs/src/content/docs/blog/discord.mdx new file mode 100644 index 0000000000..19912c6e09 --- /dev/null +++ b/docs/src/content/docs/blog/discord.mdx @@ -0,0 +1,32 @@ +--- +title: Discord Server +date: 2025-04-23 +authors: pelikhan +tags: + - discord +canonical_url: https://microsoft.github.io/genaiscript/blog/discord-server +description: Support for Tools. +cover: + alt: A retro 8-bit style illustration featuring two overlapping speech bubbles + representing communication. Below them is a simple, pixelated monitor + displaying symbols like gears, folder icons, and branching connection lines + to suggest scripts, projects, and networks. The design is geometric, flat, + and minimal, rendered with a 5-color corporate palette, focusing purely on + clean, blocky visuals without any human figures or text. + image: ./discord.png +excerpt: "Join our growing community of scripters on Discord! It's a space + designed for sharing projects, exchanging ideas, and getting answers to your + scripting questions. Connect and collaborate here: + https://discord.gg/y7HpumjHeB" + +--- +import BlogNarration from "../../../components/BlogNarration.astro" + + + +We have a Discord server for GenAIScript where you can ask questions, +share your craziest AI scripts, and connect with other scripters. + +- https://discord.gg/y7HpumjHeB + + diff --git a/docs/src/content/docs/blog/discord.png b/docs/src/content/docs/blog/discord.png new file mode 100644 index 0000000000..c911176d19 Binary files /dev/null and b/docs/src/content/docs/blog/discord.png differ diff --git a/docs/src/content/docs/blog/fallback-tools.md b/docs/src/content/docs/blog/fallback-tools.mdx similarity index 97% rename from docs/src/content/docs/blog/fallback-tools.md rename to docs/src/content/docs/blog/fallback-tools.mdx index e281ba0943..f9ea016643 100644 --- a/docs/src/content/docs/blog/fallback-tools.md +++ b/docs/src/content/docs/blog/fallback-tools.mdx @@ -24,6 +24,10 @@ excerpt: Enhance your LLM's capabilities with fallback tools. When your chosen --- +import BlogNarration from "../../../components/BlogNarration.astro" + + + [Tools](/genaiscript/reference/scripts/tools) is a powerful feature of LLM models that allows you to augment the LLM reasoning with external tools. diff --git a/docs/src/content/docs/blog/fallback-tools.png b/docs/src/content/docs/blog/fallback-tools.png index 5e59534184..e0de6a945c 100644 Binary files a/docs/src/content/docs/blog/fallback-tools.png and b/docs/src/content/docs/blog/fallback-tools.png differ diff --git a/docs/src/content/docs/blog/gentle-introduction-to-genaiscript.md b/docs/src/content/docs/blog/gentle-introduction-to-genaiscript.mdx similarity index 94% rename from docs/src/content/docs/blog/gentle-introduction-to-genaiscript.md rename to docs/src/content/docs/blog/gentle-introduction-to-genaiscript.mdx index cc7b3d3da6..747de7c94c 100644 --- a/docs/src/content/docs/blog/gentle-introduction-to-genaiscript.md +++ b/docs/src/content/docs/blog/gentle-introduction-to-genaiscript.mdx @@ -24,12 +24,16 @@ excerpt: Curious about integrating Large Language Models into your workflows? --- -Ever wondered how to leverage the power of AI and Large Language Models (LLMs) in your projects? Look no further! +import BlogNarration from "../../../components/BlogNarration.astro" + + + +Ever wondered how to leverage the power of AI and Large Language Models (LLMs) in your projects? Look no further! This post will introduce you to [GenAIScript](https://microsoft.github.io/genaiscript), a tool designed to simplify the creation of prompts and interactions with LLMs. Let's dive in! 🌊 ## What is GenAIScript? -GenAIScript uses a stylized version of JavaScript to generate prompts, which are then sent to an LLM. +GenAIScript uses a stylized version of JavaScript to generate prompts, which are then sent to an LLM. Scripts are stored as files (`genaisrc/*.genai.mjs`), executed to produce the prompt text and structured results (files, diagnostics) are extracted automatically. ## Getting Started @@ -76,7 +80,7 @@ Execute this script to see the generated user message and the assistant's respon 👤 User ```markdown -FILES: +FILES: file="src/samples/markdown.md" What is Markdown? Markdown is a lightweight markup language that... @@ -91,7 +95,7 @@ Review the documents in FILES and report the 2 most important issues. 🤖 Assistant ```markdown -I reviewed the document in "src/samples/markdown.md" +I reviewed the document in "src/samples/markdown.md" and found the following two important issues: 1. **Missing Consistency in Heading Styles**: ... @@ -122,4 +126,3 @@ Review the documents in FILES and report the 2 most important issues.` - Explore more advanced scripts by following the [Prompt As Code guide](https://microsoft.github.io/genaiscript/guides/prompt-as-code). There you have it! A gentle introduction to GenAIScript to get you started on your prompt engineering journey. Happy scripting! 💻✨ - diff --git a/docs/src/content/docs/blog/gentle-introduction-to-genaiscript.png b/docs/src/content/docs/blog/gentle-introduction-to-genaiscript.png index 4b12ab3fea..2ad8d39027 100644 Binary files a/docs/src/content/docs/blog/gentle-introduction-to-genaiscript.png and b/docs/src/content/docs/blog/gentle-introduction-to-genaiscript.png differ diff --git a/docs/src/content/docs/blog/gists.mdx b/docs/src/content/docs/blog/gists.mdx index b3f69fe0d1..fc7445fa9a 100644 --- a/docs/src/content/docs/blog/gists.mdx +++ b/docs/src/content/docs/blog/gists.mdx @@ -16,12 +16,17 @@ excerpt: GitHub Gists make it easy to share and reuse scripts across projects. streamlines collaboration and boosts productivity. --- + import { YouTube } from "astro-embed" +import BlogNarration from "../../../components/BlogNarration.astro" + + + GitHub Gists are a simple way to share and reuse scripts. You can create a Gist from any script in GenAIScript, and then share it with others or use it in your own projects. For best results, use the [GistPad](https://marketplace.visualstudio.com/items?itemName=GistPad.gistpad) extension for Visual Studio Code. GistPad allows you to create, edit, and manage your Gists directly from within VS Code. -- [Read the documentation](/genaiscript/reference/vscode/gists/) \ No newline at end of file +- [Read the documentation](/genaiscript/reference/vscode/gists/) diff --git a/docs/src/content/docs/blog/gists.png b/docs/src/content/docs/blog/gists.png index 8d2838ed2c..a40ec53924 100644 Binary files a/docs/src/content/docs/blog/gists.png and b/docs/src/content/docs/blog/gists.png differ diff --git a/docs/src/content/docs/blog/github-models-in-github-actions.mdx b/docs/src/content/docs/blog/github-models-in-github-actions.mdx new file mode 100644 index 0000000000..2ffc703bfe --- /dev/null +++ b/docs/src/content/docs/blog/github-models-in-github-actions.mdx @@ -0,0 +1,49 @@ +--- +title: GitHub Models in GitHub Actions +description: Learn how to use GitHub Models in GitHub Actions to automate your + workflows and improve your development process. +canonical_url: https://microsoft.github.io/genaiscript/blog/github-models-in-github-actions +authors: pelikhan +date: 2025-04-18 +tags: + - GitHub Actions + - Automation + - Workflows + - Models + - Development +cover: + alt: A clean 8-bit illustration uses five corporate colors to show a pixelated + digital key bridging a GitHub logo and an AI robot icon. A blocky arrow + links these icons, symbolizing smooth integration and automated workflow. + There is no text or depiction of people. + image: ./github-models-in-github-actions.png +excerpt: "Streamlining your CI/CD processes just got easier: GitHub Actions now + lets you use GITHUB_TOKEN for authentication with GitHub Models. By connecting + your workflows directly to these AI capabilities, you can sidestep the hassle + of managing separate personal access tokens and keep your automations secure + and maintainable. This update supports a seamless integration path for teams + looking to enhance workflow intelligence within the GitHub ecosystem." + +--- +import BlogNarration from "../../../components/BlogNarration.astro" + + + +You can now use `GITHUB_TOKEN` from GitHub Actions to authenticate requests to [GitHub Models](https://github.com/marketplace/models)!!! + +```yaml title="genai.yml" wrap "models: read" "GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}" +permissions: + models: read +jobs: + genai: + steps: + run: npx -y genaiscript run ... + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +``` + +This simplifies your workflows by integrating AI capabilities directly into your actions, +eliminating the need to generate and manage Personal Access Tokens (PATs)! + +- [Read GitHub Announcement](https://github.blog/changelog/2025-04-14-github-actions-token-integration-now-generally-available-in-github-models/) +- [Read Documentation](/genaiscript/getting-started/configuration#github) \ No newline at end of file diff --git a/docs/src/content/docs/blog/github-models-in-github-actions.png b/docs/src/content/docs/blog/github-models-in-github-actions.png new file mode 100644 index 0000000000..0c5afdde1c Binary files /dev/null and b/docs/src/content/docs/blog/github-models-in-github-actions.png differ diff --git a/docs/src/content/docs/blog/gpt-image-1.mdx b/docs/src/content/docs/blog/gpt-image-1.mdx new file mode 100644 index 0000000000..b07ee05019 --- /dev/null +++ b/docs/src/content/docs/blog/gpt-image-1.mdx @@ -0,0 +1,83 @@ +--- +title: GPT-Image-1 +description: A new model for generating images from text prompts +author: pelikhan +date: 2025-04-25 +cover: + alt: Three side-by-side square frames, each showing a uniquely posed 8-bit style + pixel cat. Each frame visually represents image generation from different AI + models, using five flat corporate colors and minimalist geometric + backgrounds. The cats are simple, highly pixelated, and visually distinct + from one another, with no text or people present, creating a clean, + corporate, and comparative visual suitable for a blog. + image: ./gpt-image-1.png +tags: + - openai gpt-image-1 + - image generation + - dall-e comparison + - azure ai foundry + - pixel art cat +excerpt: Our team just launched support for the new OpenAI gpt-image-1 image + generation model, now available through both OpenAI’s API and Azure AI + Foundry. We compared gpt-image-1 to DALL·E 2 and DALL·E 3 by generating 8-bit + pixel cat images using the same prompt. Each model produces distinct visual + results, and gpt-image-1 brings its own style and interpretation. This update + helps you evaluate how current generative models handle familiar creative + tasks while leveraging advances in image synthesis. Try running the same + workflows you use for existing models to see how output and prompt handling + differ with gpt-image-1. + +--- +import BlogNarration from "../../../components/BlogNarration.astro" + + + +We've added support for the new OpenAI `gpt-image-1` image generation model. +You can try out through OpenAI's API or Azure AI Foundry. + +```js 'model: "openai:gpt-image-1"' +... = await generateImage("...", { + model: "openai:gpt-image-1", +}) +``` + +To compare the performance of this model, here is a little script that +generate an pixelated cat image on DallE-2/3 and `gpt-image-1`. + +```js title="images.genai.mjs" wrap +const { output } = env +for (const model of [ + "openai:dall-e-2", + "openai:dall-e-3", + "openai:gpt-image-1", +]) { + output.heading(3, `Model: ${model}`) + const { image, revisedPrompt } = await generateImage( + `a cute cat. only one. iconic, high details. 8-bit resolution.`, + { + maxWidth: 400, + mime: "image/png", + model, + size: "square", + } + ) + await env.output.image(image.filename) + output.fence(revisedPrompt) +} +``` + +### Model: openai:dall-e-2 + +![image](./88daddda0cbe49a60fe7b11db44b2f037c0e70f8469884df13e0bbaff8bb66de.png) + +### Model: openai:dall-e-3 + +![image](./8ce06ae2b0bd7193701d7914faf3faf9b384ae6d3d8cb1d29113b47900aad66a.png) + +``` +Visualize an adorable single feline, lavishly detailed, represented in charming 8-bit resolution. This cat is incredibly distinctive and recognizable, with unique features that make it stand out from the norm. Consider adding intricate patterns on its fur or any other unusual characteristics to boost the iconic nature of this cute cat. +``` + +### Model: openai:gpt-image-1 + +![image](./9c8d4a6bd2b023110b8e716ca48acae431401adf1c8d816c9b986abefa6acafe.png) diff --git a/docs/src/content/docs/blog/gpt-image-1.png b/docs/src/content/docs/blog/gpt-image-1.png new file mode 100644 index 0000000000..522eb7186e Binary files /dev/null and b/docs/src/content/docs/blog/gpt-image-1.png differ diff --git a/docs/src/content/docs/blog/hugging-face-transformers.md b/docs/src/content/docs/blog/hugging-face-transformers.mdx similarity index 88% rename from docs/src/content/docs/blog/hugging-face-transformers.md rename to docs/src/content/docs/blog/hugging-face-transformers.mdx index 23f69b6778..52c3253f81 100644 --- a/docs/src/content/docs/blog/hugging-face-transformers.md +++ b/docs/src/content/docs/blog/hugging-face-transformers.mdx @@ -27,9 +27,15 @@ excerpt: Hugging Face Transformers.js brings large language models to your --- -

🤗

+import BlogNarration from "../../../components/BlogNarration.astro" -[Hugging Face Transformers.js](https://huggingface.co/docs/transformers.js/index) + + +

+ 🤗 +

+ +[Hugging Face Transformers.js](https://huggingface.co/docs/transformers.js/index) is a JavaScript library that provides a simple way to run LLMs in the browser or node.js (or Bun, Deno, ...). With the latest GenAIScript, you can use [Text Generation Models](https://huggingface.co/tasks/text-generation#completion-generation-models) directly in the script configuration @@ -37,7 +43,7 @@ using the [transformers](/genaiscript/getting-started/configuration#transformers ```js 'model: "transformers:HuggingFaceTB/SmolLM2-1.7B-Instruct:q4f16"' script({ - model: "transformers:HuggingFaceTB/SmolLM2-1.7B-Instruct:q4f16" + model: "transformers:HuggingFaceTB/SmolLM2-1.7B-Instruct:q4f16", }) ``` diff --git a/docs/src/content/docs/blog/hugging-face-transformers.png b/docs/src/content/docs/blog/hugging-face-transformers.png index e17c852019..251e877f67 100644 Binary files a/docs/src/content/docs/blog/hugging-face-transformers.png and b/docs/src/content/docs/blog/hugging-face-transformers.png differ diff --git a/docs/src/content/docs/blog/llm-agents.md b/docs/src/content/docs/blog/llm-agents.mdx similarity index 98% rename from docs/src/content/docs/blog/llm-agents.md rename to docs/src/content/docs/blog/llm-agents.mdx index 4b037523e7..09099043a3 100644 --- a/docs/src/content/docs/blog/llm-agents.md +++ b/docs/src/content/docs/blog/llm-agents.mdx @@ -29,6 +29,10 @@ excerpt: GenAIScript redefines how agents interact with users by integrating --- +import BlogNarration from "../../../components/BlogNarration.astro" + + + GenAIScript defines an [**agent**](/genaiscript/reference/scripts/agents) as a [tool](/genaiscript/reference/scripts/tools) that runs an [inline prompt](/genaiscript/reference/scripts/inline-prompts) to accomplish a task. The agent LLM is typically augmented with additional tools. diff --git a/docs/src/content/docs/blog/llm-agents.png b/docs/src/content/docs/blog/llm-agents.png index 990d0bc502..2af81d1779 100644 Binary files a/docs/src/content/docs/blog/llm-agents.png and b/docs/src/content/docs/blog/llm-agents.png differ diff --git a/docs/src/content/docs/blog/makeitbetter.md b/docs/src/content/docs/blog/makeitbetter.mdx similarity index 96% rename from docs/src/content/docs/blog/makeitbetter.md rename to docs/src/content/docs/blog/makeitbetter.mdx index 9915b64a59..90b45ed17a 100644 --- a/docs/src/content/docs/blog/makeitbetter.md +++ b/docs/src/content/docs/blog/makeitbetter.mdx @@ -24,6 +24,10 @@ excerpt: Harnessing the power of the `makeItBetter` function in GenAIScript --- +import BlogNarration from "../../../components/BlogNarration.astro" + + + GenAIScript comes with a helper that tells the LLM to "make it better". It's a surprising way to improve your code by repeating a set of instructions multiple times. diff --git a/docs/src/content/docs/blog/makeitbetter.png b/docs/src/content/docs/blog/makeitbetter.png index fd9909def2..e3e1d3d7c9 100644 Binary files a/docs/src/content/docs/blog/makeitbetter.png and b/docs/src/content/docs/blog/makeitbetter.png differ diff --git a/docs/src/content/docs/blog/mcp-agents.mdx b/docs/src/content/docs/blog/mcp-agents.mdx index 81edd20d4f..c4e0fa6c5a 100644 --- a/docs/src/content/docs/blog/mcp-agents.mdx +++ b/docs/src/content/docs/blog/mcp-agents.mdx @@ -33,6 +33,10 @@ excerpt: Configure and run multiple MCP servers in parallel with agent support. --- +import BlogNarration from "../../../components/BlogNarration.astro" + + + We've added support to configure MCP servers in the script metadata and wrap them with agents. As a result, you can now run multiple MCP servers in parallel, each with its own agent. diff --git a/docs/src/content/docs/blog/mcp-agents.png b/docs/src/content/docs/blog/mcp-agents.png index 7fad731966..d069273f52 100644 Binary files a/docs/src/content/docs/blog/mcp-agents.png and b/docs/src/content/docs/blog/mcp-agents.png differ diff --git a/docs/src/content/docs/blog/mcp-intents.mdx b/docs/src/content/docs/blog/mcp-intents.mdx index c3bedbdd53..210a54ab95 100644 --- a/docs/src/content/docs/blog/mcp-intents.mdx +++ b/docs/src/content/docs/blog/mcp-intents.mdx @@ -30,6 +30,10 @@ excerpt: Exploring the integration of intent validation within tool response --- +import BlogNarration from "../../../components/BlogNarration.astro" + + + Following up the previous post on [MCP Tool Validation](/genaiscript/blog/mcp-tool-validation), we have added an experimental tool intent validation to mitigate risks associated to MCP tools. diff --git a/docs/src/content/docs/blog/mcp-intents.png b/docs/src/content/docs/blog/mcp-intents.png index bae4836fdd..82cc85db36 100644 Binary files a/docs/src/content/docs/blog/mcp-intents.png and b/docs/src/content/docs/blog/mcp-intents.png differ diff --git a/docs/src/content/docs/blog/mcp-resources.mdx b/docs/src/content/docs/blog/mcp-resources.mdx index 7209376b5e..e226e2b088 100644 --- a/docs/src/content/docs/blog/mcp-resources.mdx +++ b/docs/src/content/docs/blog/mcp-resources.mdx @@ -27,6 +27,10 @@ excerpt: The Model Context Protocol (MCP) introduces a powerful way for scripts --- +import BlogNarration from "../../../components/BlogNarration.astro" + + + # MCP Resources In a [previous post](/genaiscript/blog/scripts-as-mcp-tools/), diff --git a/docs/src/content/docs/blog/mcp-resources.png b/docs/src/content/docs/blog/mcp-resources.png index c814c4f672..fb7999d257 100644 Binary files a/docs/src/content/docs/blog/mcp-resources.png and b/docs/src/content/docs/blog/mcp-resources.png differ diff --git a/docs/src/content/docs/blog/mcp-tool-validation.mdx b/docs/src/content/docs/blog/mcp-tool-validation.mdx index 48596c676b..d05c456ce5 100644 --- a/docs/src/content/docs/blog/mcp-tool-validation.mdx +++ b/docs/src/content/docs/blog/mcp-tool-validation.mdx @@ -25,6 +25,10 @@ excerpt: GenAIScript has introduced updates to enhance the security of Model --- +import BlogNarration from "../../../components/BlogNarration.astro" + + + GenAIScript added a few feature to secure Model Context Protocol (MCP) tools and mitigate specific attacks such as rug pull, tool poisoning, or prompt injection. Starting with `v1.127`, you can configure the following options as [documented here](/genaiscript/reference/scripts/mcp-tools#security): diff --git a/docs/src/content/docs/blog/mcp-tool-validation.png b/docs/src/content/docs/blog/mcp-tool-validation.png index 2d12496f1b..7eeb239623 100644 Binary files a/docs/src/content/docs/blog/mcp-tool-validation.png and b/docs/src/content/docs/blog/mcp-tool-validation.png differ diff --git a/docs/src/content/docs/blog/node-api.mdx b/docs/src/content/docs/blog/node-api.mdx index 424150b9a1..d07e6bc437 100644 --- a/docs/src/content/docs/blog/node-api.mdx +++ b/docs/src/content/docs/blog/node-api.mdx @@ -26,6 +26,10 @@ excerpt: "Introducing a new Node.js API for GenAIScript: now you can integrate import { PackageManagers } from "starlight-package-managers" +import BlogNarration from "../../../components/BlogNarration.astro" + + + A long standing feature request has been to run GenAIScript programmatically from other scripts. We are happy to announce that we have released a Node.JS API for GenAIScript. This API allows you to call GenAIScript from other TypeScript scripts (v1.83+). - [Documentation](https://microsoft.github.io/genaiscript/reference/api/) diff --git a/docs/src/content/docs/blog/node-api.png b/docs/src/content/docs/blog/node-api.png index 9750a49351..a51247a0d8 100644 Binary files a/docs/src/content/docs/blog/node-api.png and b/docs/src/content/docs/blog/node-api.png differ diff --git a/docs/src/content/docs/blog/playground.mdx b/docs/src/content/docs/blog/playground.mdx index 1b3118b552..4d61434314 100644 --- a/docs/src/content/docs/blog/playground.mdx +++ b/docs/src/content/docs/blog/playground.mdx @@ -23,15 +23,18 @@ excerpt: The latest GenAIScript update introduces a self-hosted Playground app, with versatile integrations for advanced scripting. --- + import { Image } from "astro:assets" import src from "../../../assets/playground.png" import alt from "../../../assets/playground.png.txt?raw" +import BlogNarration from "../../../components/BlogNarration.astro" + + The newly 2025 release brings a number of new features and support for new models. ## Playground - The [Playground](/genaiscript/reference/playground) is a self-hosted web application that allows you to run GenAIScript scripts from a friendly user interface. It sits between the GenAIScript CLI and the GenAIScript Visual Studio Code integration. diff --git a/docs/src/content/docs/blog/playground.png b/docs/src/content/docs/blog/playground.png index b8fb683989..c51fee8027 100644 Binary files a/docs/src/content/docs/blog/playground.png and b/docs/src/content/docs/blog/playground.png differ diff --git a/docs/src/content/docs/blog/prompting-is-the-new-scripting.mdx b/docs/src/content/docs/blog/prompting-is-the-new-scripting.mdx index 0e34001674..fe5fb5252d 100644 --- a/docs/src/content/docs/blog/prompting-is-the-new-scripting.mdx +++ b/docs/src/content/docs/blog/prompting-is-the-new-scripting.mdx @@ -27,12 +27,15 @@ excerpt: Yohan Lasorsa presented GenAIScript at dotJS 2025, showcasing how it --- import { YouTube } from "astro-embed" +import BlogNarration from "../../../components/BlogNarration.astro" + + [Yohan Lasorsa](https://www.linkedin.com/in/yohanlasorsa/) gave a talk at dotJS 2025 about GenAIScript, a new way to interact with AI models using a scripting language. -Yohan Lasorsa is a Principal Developer Advocate at Microsoft, a Google Developer Expert for Angular, and an active open-source author and contributor. -With 15+ years of experience across applied research, mobile, IoT, and cloud architecture, -he has worked from low-level systems to full-stack web development. +Yohan Lasorsa is a Principal Developer Advocate at Microsoft, a Google Developer Expert for Angular, and an active open-source author and contributor. +With 15+ years of experience across applied research, mobile, IoT, and cloud architecture, +he has worked from low-level systems to full-stack web development. Whether building applications or DIY projects, he loves sharing knowledge and pushing the limits of what’s possible. - + diff --git a/docs/src/content/docs/blog/prompting-is-the-new-scripting.png b/docs/src/content/docs/blog/prompting-is-the-new-scripting.png index 880f3b2fcf..35553f68e3 100644 Binary files a/docs/src/content/docs/blog/prompting-is-the-new-scripting.png and b/docs/src/content/docs/blog/prompting-is-the-new-scripting.png differ diff --git a/docs/src/content/docs/blog/readme-maintenance.md b/docs/src/content/docs/blog/readme-maintenance.mdx similarity index 98% rename from docs/src/content/docs/blog/readme-maintenance.md rename to docs/src/content/docs/blog/readme-maintenance.mdx index 2c7e1e92b0..5d02469738 100644 --- a/docs/src/content/docs/blog/readme-maintenance.md +++ b/docs/src/content/docs/blog/readme-maintenance.mdx @@ -30,6 +30,10 @@ excerpt: A strong `README` can define your project's success in the open source --- +import BlogNarration from "../../../components/BlogNarration.astro" + + + In the world of open source, a well-maintained `README` file acts as the front door to your project. It's often the first thing potential users and contributors see, and as such, it should be both informative and inviting. Today, we're diving into the GenAIScript that helps keep the `README` of the [GenAI project](https://github.com/microsoft/genaiscript) as fresh as a daisy! 🌼 Check out the actual [script file](https://github.com/microsoft/genaiscript/blob/main/packages/sample/genaisrc/readme-updater.genai.mts) for the details. > This blog post was co-authored with a [script](https://github.com/microsoft/genaiscript/blob/main/packages/sample/genaisrc/blogify-sample.genai.mts). diff --git a/docs/src/content/docs/blog/readme-maintenance.png b/docs/src/content/docs/blog/readme-maintenance.png index d5749606cc..a928b74229 100644 Binary files a/docs/src/content/docs/blog/readme-maintenance.png and b/docs/src/content/docs/blog/readme-maintenance.png differ diff --git a/docs/src/content/docs/blog/scripts-as-mcp-tools.md b/docs/src/content/docs/blog/scripts-as-mcp-tools.mdx similarity index 96% rename from docs/src/content/docs/blog/scripts-as-mcp-tools.md rename to docs/src/content/docs/blog/scripts-as-mcp-tools.mdx index efc58cd4dc..681b769bd6 100644 --- a/docs/src/content/docs/blog/scripts-as-mcp-tools.md +++ b/docs/src/content/docs/blog/scripts-as-mcp-tools.mdx @@ -25,6 +25,10 @@ excerpt: The Model Context Protocol (MCP) is reshaping how we approach --- +import BlogNarration from "../../../components/BlogNarration.astro" + + + 🚀 The [Model Context Protocol (MCP)](https://modelcontextprotocol.io/introduction) is taking the tech world by storm, and we're thrilled to announce that GenAIScript is at the forefront of this revolution! With the rapid adoption of MCP, tools like GitHub Copilot Chat are already integrating support (available in Insiders today), and [Copilot Studio](https://www.microsoft.com/en-us/microsoft-copilot/blog/copilot-studio/introducing-model-context-protocol-mcp-in-copilot-studio-simplified-integration-with-ai-apps-and-agents/) has just announced their support as well. diff --git a/docs/src/content/docs/blog/scripts-as-mcp-tools.png b/docs/src/content/docs/blog/scripts-as-mcp-tools.png index 99409696f1..9c83725175 100644 Binary files a/docs/src/content/docs/blog/scripts-as-mcp-tools.png and b/docs/src/content/docs/blog/scripts-as-mcp-tools.png differ diff --git a/docs/src/content/docs/blog/search-transform-genai.md b/docs/src/content/docs/blog/search-transform-genai.mdx similarity index 95% rename from docs/src/content/docs/blog/search-transform-genai.md rename to docs/src/content/docs/blog/search-transform-genai.mdx index 4cde1b7001..7780b95bb0 100644 --- a/docs/src/content/docs/blog/search-transform-genai.md +++ b/docs/src/content/docs/blog/search-transform-genai.mdx @@ -26,6 +26,10 @@ excerpt: Ever found yourself manually sifting through files to identify patterns --- +import BlogNarration from "../../../components/BlogNarration.astro" + + + Have you ever found yourself in a situation where you need to search through multiple files in your project, find a specific pattern, and then apply a transformation to it? It can be a tedious task, but fear not! In this blog post, I'll walk you through a GenAIScript that does just that, automating the process and saving you time. 🕒💡 For example, when GenAIScript added the ability to use a string command string in diff --git a/docs/src/content/docs/blog/search-transform-genai.png b/docs/src/content/docs/blog/search-transform-genai.png index 19db0a9551..a336c48c27 100644 Binary files a/docs/src/content/docs/blog/search-transform-genai.png and b/docs/src/content/docs/blog/search-transform-genai.png differ diff --git a/docs/src/content/docs/blog/super-charge-copilot-chat.mdx b/docs/src/content/docs/blog/super-charge-copilot-chat.mdx index cf44affb79..741f3173af 100644 --- a/docs/src/content/docs/blog/super-charge-copilot-chat.mdx +++ b/docs/src/content/docs/blog/super-charge-copilot-chat.mdx @@ -29,6 +29,9 @@ excerpt: "Here’s a game-changer for boosting GitHub Copilot Chat’s performan import prompt from "../../../../../.github/prompts/genaiscript.prompt.md?raw" import { Code } from "@astrojs/starlight/components" import { YouTube } from "astro-embed" +import BlogNarration from "../../../components/BlogNarration.astro" + + Do you know to know an awesome trick to make GitHub Copilot Chat an expert in GenAIScript? Here's how you can supercharge your Copilot chat with simple technique. @@ -64,4 +67,4 @@ GenAIScript leverages these features by adding a custom prompt that includes the ## To be continued -This technique is really new and there's probably lots of improvment to be done. \ No newline at end of file +This technique is really new and there's probably lots of improvment to be done. diff --git a/docs/src/content/docs/blog/super-charge-copilot-chat.png b/docs/src/content/docs/blog/super-charge-copilot-chat.png index a5ddfafa31..e26a538c2f 100644 Binary files a/docs/src/content/docs/blog/super-charge-copilot-chat.png and b/docs/src/content/docs/blog/super-charge-copilot-chat.png differ diff --git a/docs/src/content/docs/blog/support-for-agentic-tools.md b/docs/src/content/docs/blog/support-for-agentic-tools.mdx similarity index 84% rename from docs/src/content/docs/blog/support-for-agentic-tools.md rename to docs/src/content/docs/blog/support-for-agentic-tools.mdx index 5897b8b8b6..1a9d60e368 100644 --- a/docs/src/content/docs/blog/support-for-agentic-tools.md +++ b/docs/src/content/docs/blog/support-for-agentic-tools.mdx @@ -21,6 +21,10 @@ excerpt: Agentic is a TypeScript library designed to streamline AI tool --- +import BlogNarration from "../../../components/BlogNarration.astro" + + + [Agentic](https://agentic.so/) is a standard library of TypeScript AI tools optimized for both TS-usage as well as LLM-based usage, which is really important for testing and debugging. Agentic brings support for a variety of online APIs, like Bing, Wolfram Alpha, Wikipedia, and more. You can register any [Agentic tool](https://agentic.so/tools/) in your script using `defTool`. Here's an example of how to use the Weather tool: @@ -31,5 +35,5 @@ const weather = new WeatherClient() defTool(weather) ``` -- [Agentic documentation](https://agentic.so/sdks/genaiscript) -- [GenAIScript documentation](https://microsoft.github.io/genaiscript/guides/agentic-tools/) +- [Agentic documentation](https://agentic.so/sdks/genaiscript) +- [GenAIScript documentation](https://microsoft.github.io/genaiscript/guides/agentic-tools/) diff --git a/docs/src/content/docs/blog/support-for-agentic-tools.png b/docs/src/content/docs/blog/support-for-agentic-tools.png index c51af8b8f6..c9d4efbe86 100644 Binary files a/docs/src/content/docs/blog/support-for-agentic-tools.png and b/docs/src/content/docs/blog/support-for-agentic-tools.png differ diff --git a/docs/src/content/docs/blog/video-introduction.mdx b/docs/src/content/docs/blog/video-introduction.mdx index db403d13fe..45b28bbd70 100644 --- a/docs/src/content/docs/blog/video-introduction.mdx +++ b/docs/src/content/docs/blog/video-introduction.mdx @@ -19,15 +19,18 @@ excerpt: "The first tutorial in the GenAIScript series is now available, diving https://youtu.be/ENunZe--7j0" --- -import { YouTube } from 'astro-embed'; + +import { YouTube } from "astro-embed" +import BlogNarration from "../../../components/BlogNarration.astro" + + The very first tutorial video on GenAIScript is out on YouTube. -It took a while to get back the setup but we are now ready to start the series of tutorials +It took a while to get back the setup but we are now ready to start the series of tutorials on GenAIScript. Use discussions if you want to suggest a topic for the next video. - youtube url: https://youtu.be/ENunZe--7j0 - playlist: https://www.youtube.com/playlist?list=PLTz1gR9D9ZMVioMqT8y0F6Jr2LizAANIm - - + diff --git a/docs/src/content/docs/blog/video-introduction.png b/docs/src/content/docs/blog/video-introduction.png index 248abd53e6..74e44413bb 100644 Binary files a/docs/src/content/docs/blog/video-introduction.png and b/docs/src/content/docs/blog/video-introduction.png differ diff --git a/docs/src/content/docs/blog/video.md b/docs/src/content/docs/blog/video.mdx similarity index 96% rename from docs/src/content/docs/blog/video.md rename to docs/src/content/docs/blog/video.mdx index 1b089ae727..bd8446eba6 100644 --- a/docs/src/content/docs/blog/video.md +++ b/docs/src/content/docs/blog/video.mdx @@ -25,6 +25,10 @@ excerpt: Analyze videos with ease. Traditional LLMs require timestamp-based --- +import BlogNarration from "../../../components/BlogNarration.astro" + + + The latest release includes support for including videos and audio transcripts in your scripts. ```js wrap diff --git a/docs/src/content/docs/blog/video.png b/docs/src/content/docs/blog/video.png index 72ec3d729c..a596d31c61 100644 Binary files a/docs/src/content/docs/blog/video.png and b/docs/src/content/docs/blog/video.png differ diff --git a/docs/src/content/docs/blog/we-have-a-podcast.png b/docs/src/content/docs/blog/we-have-a-podcast.png index 2e4f7f19d0..c93e23970e 100644 Binary files a/docs/src/content/docs/blog/we-have-a-podcast.png and b/docs/src/content/docs/blog/we-have-a-podcast.png differ diff --git a/docs/src/content/docs/blog/webview.md b/docs/src/content/docs/blog/webview.mdx similarity index 96% rename from docs/src/content/docs/blog/webview.md rename to docs/src/content/docs/blog/webview.mdx index 1929d3061b..846eca9d0d 100644 --- a/docs/src/content/docs/blog/webview.md +++ b/docs/src/content/docs/blog/webview.mdx @@ -28,6 +28,10 @@ excerpt: We've enhanced the GenAIScript experience by moving beyond Visual --- +import BlogNarration from "../../../components/BlogNarration.astro" + + + In the past, our Visual Studio Code visualization has relied on the built-in Markdown preview feature. It's been working great but sometimes it's not enough. We wanted to provide a more interactive experience for our users. So we decided to build a custom webview for GenAIScript. Rebuilding the view also gives us more control on supporting the rendering of various markdown subformats like mermaid diagrams, annotations, math, ... diff --git a/docs/src/content/docs/blog/webview.png b/docs/src/content/docs/blog/webview.png index f97be3a75f..33db3f882d 100644 Binary files a/docs/src/content/docs/blog/webview.png and b/docs/src/content/docs/blog/webview.png differ diff --git a/docs/src/content/docs/getting-started/automating-scripts.mdx b/docs/src/content/docs/getting-started/automating-scripts.mdx index 3173f1272e..15eb93a159 100644 --- a/docs/src/content/docs/getting-started/automating-scripts.mdx +++ b/docs/src/content/docs/getting-started/automating-scripts.mdx @@ -1,9 +1,19 @@ --- title: Automating scripts sidebar: - order: 5 -description: Learn how to automate your scripts using the GenAIScript CLI for efficient batch processing and integration into CI/CD pipelines. + order: 5 +description: Learn how to automate your scripts using the GenAIScript CLI for + efficient batch processing and integration into CI/CD pipelines. keywords: automation, CLI, batch processing, CI/CD integration, script execution +hero: + image: + alt: A simple, flat 8-bit icon displays a geometric laptop alongside a cogwheel + and checkmark, a stylized file tree linked by lines, a small cloud with an + upload arrow, and a basic shield representing security. All elements use a + five-color corporate palette, arranged on a transparent background in a + 128x128 pixel square, with no people, text, shadows, or 3D effects. + file: ./automating-scripts.png + --- import { Steps } from "@astrojs/starlight/components" @@ -77,7 +87,7 @@ Use the [cli](/genaiscript/reference/cli/run/) to run the script in a GitHub Act - use the `--out ` flag to store the results in a directory so that you can upload them as an artifact. ```yaml -- run: npx --yes genaiscript run