Same agent Smaller bill. The tools and infrastructure to get more work from your AI. Fewer tokens. Less compute. Lower cost.
TypeScript agent-harnessagent-harness-engineeringai-engineeringai-observabilityamd-gpuclaude-codeclickhousecodexcoding-agentcoding-agentscursorgenaigpu-monitoringllm-observabilityllmopsnvidia-smiobservabilityopen-sourceopenaiopentelemetry
update file
patcher9272647aa4219
diff --git a/.github/workflows/pricing-test.yml b/.github/workflows/pricing-test.ymlindex d5254567..93f1cc63 100644--- a/.github/workflows/pricing-test.yml+++ b/.github/workflows/pricing-test.yml@@ -2,96 +2,93 @@ name: Validate Pricing Fileon:push:- branches: [ "main" ]- pull_request_target:- branches: [ "main" ]+ paths:+ - 'assets/pricing.json'+ pull_request:+ paths:+ - 'assets/pricing.json'jobs:validate-pricing:runs-on: ubuntu-lateststeps:- - name: Checkout base code- uses: actions/checkout@v2- with:- ref: ${{ github.event.pull_request.head.sha }}+ - name: Checkout Code+ uses: actions/checkout@v3- name: Validate JSON structureid: validaterun: |- file=assets/pricing.json+ file=assets/pricing.json- echo "Validating JSON format..."- if ! jq empty $file; then+ echo "Validating JSON format..."+ if ! jq empty "$file"; thenecho "Invalid JSON format"exit 1- fi+ fi- keys=("embeddings" "images" "audio" "chat")- echo "Checking top-level keys..."- for key in "${keys[@]}"; do- if ! jq --exit-status ".[$key]" $file > /dev/null; then- echo "Missing key: $key"- exit 1+ # Verify top-level keys+ keys=("embeddings" "images" "audio" "chat")+ for key in "${keys[@]}"; do+ if ! jq --exit-status ". | has(\"$key\")" "$file" > /dev/null; then+ echo "Missing key: $key"+ exit 1fi- done-- echo "Validation JSON structure is valid"+ done++ echo "Validating JSON structure is valid"- name: Custom Validation Logicid: custom-validaterun: |- file=assets/pricing.json+ file=assets/pricing.json- # Validate Chat Models- echo "Validating chat models..."- chat_keys=("promptPrice" "completionPrice")- for model in $(jq -r '.chat | keys[]' $file); do+ # Validate Chat Models+ echo "Validating chat models..."+ chat_keys=("promptPrice" "completionPrice")+ for model in $(jq -r '.chat | keys[]' "$file"); dofor key in "${chat_keys[@]}"; do- if ! jq --exit-status ".chat[\"$model\"] | has(\"$key\")" $file > /dev/null; then+ if ! jq --exit-status ".chat[\"$model\"] | has(\"$key\")" "$file" > /dev/null; thenecho "Chat model $model missing key: $key"exit 1- fi- done+ fidone+ done- # Validate Audio Models- echo "Validating audio models..."- audio_keys=("price")- for model in $(jq -r '.audio | keys[]' $file); do- for key in "${audio_keys[@]}"; do- if ! jq --exit-status ".audio[\"$model\"] | has(\"$key\")" $file > /dev/null; then- echo "Audio model $model missing key: $key"- exit 1- fi- done- done+ # Validate Audio Models+ echo "Validating audio models..."+ for model in $(jq -r '.audio | keys[]' "$file"); do+ if ! jq --exit-status ".audio[\"$model\"]" "$file" > /dev/null; then+ echo "Audio model $model is invalid."+ exit 1+ fi+ done- # Validate Images Models- echo "Validating images models..."- image_categories=("standard" "hd" "premium")- for model in $(jq -r '.images | keys[]' $file); do+ # Validate Images Models+ echo "Validating images models..."+ image_categories=("standard" "hd" "premium")+ for model in $(jq -r '.images | keys[]' "$file"); dofor category in "${image_categories[@]}"; do- if jq --exit-status ".images[\"$model\"] | has(\"$category\")" $file > /dev/null; then- for resolution in $(jq -r ".images[\"$model\"].$category | keys[]" $file); do- if ! jq --exit-status ".images[\"$model\"].$category[\"$resolution\"]" $file > /dev/null; then+ if jq --exit-status ".images[\"$model\"] | has(\"$category\")" "$file" > /dev/null; then+ for resolution in $(jq -r ".images[\"$model\"].$category | keys[]" "$file"); do+ if ! jq --exit-status ".images[\"$model\"].$category[\"$resolution\"]" "$file" > /dev/null; thenecho "Image model $model category $category resolution $resolution is invalid."exit 1- fi+ fidone- fi- done+ fidone+ done- # Validate Embeddings Models- echo "Validating embeddings models..."- for model in $(jq -r '.embeddings | keys[]' $file); do- if ! jq --exit-status ".embeddings[\"$model\"]" $file > /dev/null; then- echo "Embedding model $model is invalid."- exit 1+ # Validate Embeddings Models+ echo "Validating embeddings models..."+ for model in $(jq -r '.embeddings | keys[]' "$file"); do+ if ! jq --exit-status ".embeddings[\"$model\"]" "$file" > /dev/null; then+ echo "Embedding model $model is invalid."+ exit 1fi- done-- echo "All validations passed"+ done++ echo "All validations passed"- name: Successif: success()@@ -99,4 +96,4 @@ jobs:- name: Failureif: failure()- run: echo "Pricing file validation failed." && exit 1\ No newline at end of file+ run: echo "Pricing file validation failed."\ No newline at end of file