Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gloo AI Python Quickstart (pipenv)

This minimal example was built in response to the Slack thread in #support-gloo-ai (https://servant-io.slack.com/archives/C08QPAK2QAX/p1764093157738929) asking for a working Python snippet after a developer hit 403 forbidden when calling the quickstart API.

What this does

  • Loads GLOO_AI_CLIENT_ID and GLOO_AI_CLIENT_SECRET from a local .env.
  • Requests an OAuth token with the api/access scope.
  • Calls the chat completions endpoint using meta.llama3-70b-instruct-v1:0.
  • Prints the token expiration and the JSON completion response.

For the full walkthrough, see the official quickstart docs: https://docs.gloo.com/getting-started/quickstart-developers.

Setup

  1. Ensure Python 3.11 is available.
  2. Create .env (already gitignored) with:
    GLOO_AI_CLIENT_ID=...
    GLOO_AI_CLIENT_SECRET=...
    
    The provided demo values are already placed in .env for convenience; replace if you have org-specific credentials.
  3. Install deps and lock via pipenv:
    pipenv install --python 3.11

Run

pipenv run gloo-chat

Format

pipenv run format

Uses black via the Pipfile script to format the repository.

Notes / troubleshooting

  • A 403 usually means the token lacks the right scope or the Authorization header is malformed. This example uses grant_type=client_credentials with scope=api/access and sets Authorization: Bearer <token>, matching the published quickstart.
  • If you rotate credentials, update .env and rerun.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages