txmap 3.1.5

A concurrent transactional hash map for Rust with fine-grained locking, internal mutability and composable transactions
Documentation
name: "Question pi"
description: "Ask a question of pi providing a validated response according to the json schema"
inputs:
  context-base64:
    description: "Context to send to pi in base64"
    required: true
  prompt-base64:
    description: "Prompt to send to pi in base64"
    required: true
  schema-base64:
    description: "Json schema to validate the response with in base64"
    required: true
outputs:
  response-base64:
    description: "Response json formatted in schema in base64"
    value: ${{ steps.pi-response.outputs.pi-response-base64 }}
runs:
  using: "composite"
  steps:
    - shell: bash
      id: pi-response
      run: |
        CONTEXT=$(echo "${{ inputs.context-base64 }}" | base64 -d)
        PROMPT=$(echo "${{ inputs.prompt-base64 }}" | base64 -d)
        SCHEMA=$(echo "${{ inputs.schema-base64 }}" | base64 -d)
        echo "${PROMPT}"
        echo "${SCHEMA}"
        PI_PROMPT="${PROMPT}"$'\n\n'" <Start of context> ${CONTEXT} <End of context>"
        JSON_OUTPUT_FILE=$(mktemp)
        PI_RESPONSE=$(pi \
          --provider deepseek \
          --model deepseek-v4-pro \
          --tools read,bash,grep,find,ls,json_output \
          --json-schema "${SCHEMA}" \
          --json-fallback force \
          --json-output "${JSON_OUTPUT_FILE}" \
          --print "${PI_PROMPT}" \
          )
        echo "${PI_RESPONSE}"
        if [ ! -s "${JSON_OUTPUT_FILE}" ]; then
          echo "Error: pi did not write a schema-validated JSON output to ${JSON_OUTPUT_FILE}" >&2
          exit 1
        fi
        PI_RESPONSE_BASE64=$(base64 -w 0 < "${JSON_OUTPUT_FILE}")
        rm -f "${JSON_OUTPUT_FILE}"
        echo "pi-response-base64=${PI_RESPONSE_BASE64}" >> "$GITHUB_OUTPUT"