Skip to main content

prediction-api

  • App will receive an HTTP POST call in this format
curl -X POST
    -H 'Authorization: Key API_KEY'
    -H "Content-Type: application/json"
    -d '
    {
      "inputs": [
        {
          "data": {
            "image": {
              "url": "https://lh3.googleusercontent.com/GNE-0Vga-Uffz1i9oxP0ueYYvPW8qG_z7_IlQX3yCqPNILam2Z-rlkYzjoRGkPp74XeEkVb96r1-N1-yRKGhvkFQK5uI=s256"
            }
          }
        }
      ]
    }'
    https://prediction-api-dot-platform-ai-dev.appspot.com/v1/project?id=ahFzfnBsYXRmb3JtLWFpLWRldnJTCxIEVXNlciIcMGFXdExZREhlU1puZ3F1SUxpYXUzQ0NFQ1FFMgwLEgdQcm9qZWN0IiA2MmEwMjYyYjNiYTI0NDA4OGNlYTgyYjg0MTQ1MDg3Mww
  • Since this is a multi-tenant application and we cannot redploy it (or use the same key for multi customers), in order to turn on a new tenant, API keys need to be managed in Google Data Store. Project type in Datastore has a reference to valid API keys that can access it for prediction.

  • Import model_utilities from platform-ai package (TBD)

    model = get_model(project_id)
    model.predict_from_url(URL) returns prediction json

  • cache the model in memorystore for future requests, backend will invalidate this cache if/when the model is retrained

Error codes

  • Bad URL / not accessible
  • project_id invalid
  • rate limit exceeded
  • no trained model is available
  • backend error / something blew up

Metadata

Release files for platform-ai 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for platform-ai 0.0.1
File Size Uploaded
platform-ai-0.0.1.tar.gz 2.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for platform-ai 0.0.1
File Interpreter ABI Platform
platform_ai-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 5.5 kB

Release files / platform-ai-0.0.1.tar.gz

Download URL platform-ai-0.0.1.tar.gz
Size 2.4 kB
Tags Source
SHA-256 checksum
How to use checksums
614aa5a33e1dcd152edf85f980c6646ba4a2611f5fb0cd49b818ed9327ed5681
BLAKE2b-256 checksum
How to use checksums
cb94cee5b26d77d5231b4eafb28694d0c2a866f9aa784c75bf924b8ab2ce86ac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/39.1.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.5

Release files / platform_ai-0.0.1-py3-none-any.whl

Download URL platform_ai-0.0.1-py3-none-any.whl
Size 3.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9140df86156f5c52697b81124a6e4adbe61865271f2b55897507dfc52d5784db
BLAKE2b-256 checksum
How to use checksums
e1caef04bdcedffc554d5a6f3a2431c5bdfb937b6a4f30a776ec21d7a3a6d1c6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/39.1.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.5

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page