A python client to interact with the Glif API.
pip install glif-client
Create a Glif account and create a new API token here.
export GLIF_API_TOKEN="your-token"
Example:
from glif_client import GlifClient
# supply `api_token` or set it as an environment variable named GLIF_API_TOKEN
glif_api = GlifClient(api_token="your-token")
# option 1, positional args
simple_args = ["a happy horse", "foobar"]
response = glif_api.run_simple("cm023wc6m0009k7ur9ta0g14f", simple_args)
print(response)
# option 2, named args
named_args = {
"prompt": "a happy horse",
"other_parameter": "foobar",
}
response = glif_api.run_simple("cm023wc6m0009k7ur9ta0g14f", named_args)
print(response)
import logging
logging.basicConfig(level=logging.DEBUG)
Install dev deps:
pip install -r requirements.dev.txt
There's a makefile with two handy commands:
make test # run the little test suite
make style # run formatting
- More API docs: https://docs.glif.app/api/getting-started