Skip to main content

No project description provided

This project has been archived.

The maintainers of this project have marked this project as archived. No new releases are expected.

Project description

LlamaAPI SDK

LlamaAPI is a Python SDK for interacting with the Llama API. It abstracts away the handling of aiohttp sessions and headers, allowing for a simplified interaction with the API.

Installation

You can install the LlamaAPI SDK using pip:

pip install llamaapi

Usage

After installing the SDK, you can use it in your Python projects like so:

from llamaapi import llamaapi

# Initialize the llamaapi with your api_token
llama = LlamaAPI('<your_api_token>')

# Define your API request
api_request_json = {
  "messages": [
    {"role": "user", "content": "What is the weather like in Boston?"},
  ],
  "functions": [
    {
      "name": "get_current_weather",
      "description": "Get the current weather in a given location",
      "parameters": {
          "type": "object",
          "properties": {
              
            "location": {
              "type": "string",
              "description": "The city and state, e.g. San Francisco, CA"
            },
            "days": {
              "type": "number",
              "description": "for how many days ahead you wants the forecast"
            },
            "unit": {
              "type": "string",
              "enum": ["celsius", "fahrenheit"]
            }
          }
      },
      "required": ["location", "days"]
    }
  ],
  "stream": True,
  "function_call": "get_current_weather"
}

# Make your request and handle the response
sequences = llama.run(api_request_json)
for seq in sequences:
    print(seq)

Note: The run function is asynchronous and will return when all the data from the server has been received.

Change Log

Version 0.1: Initial release

Contributing

We welcome contributions to this project. Please see the Contributing Guidelines for more details.

License

llamaapi SDK is licensed under the MIT License. Please see the License File for more details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

apillama-0.1.5.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

apillama-0.1.5-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file apillama-0.1.5.tar.gz.

File metadata

  • Download URL: apillama-0.1.5.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.9.13 Linux/5.15.0-73-generic

File hashes

Hashes for apillama-0.1.5.tar.gz
Algorithm Hash digest
SHA256 e48bccf8fdda61efc2f5432cee263be761396e89fdcd1134d6e1b49e153b520c
MD5 e3d884db650c0546aea380e0f1e3708f
BLAKE2b-256 00681e9ce069fcf422ec1f9c6e0b7734c486fb44e0c1ab44c24923bbb20427b1

See more details on using hashes here.

File details

Details for the file apillama-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: apillama-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 3.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.9.13 Linux/5.15.0-73-generic

File hashes

Hashes for apillama-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 ba4383222f728e81bec8cb2b3926f2fded0d0b2a44e6f78037af9c19d356c051
MD5 e95e63a18e74b7b70c8dd35b246d879f
BLAKE2b-256 7884c80f2864e6930475e79a7903e3a5c47719e2ad00ba1de7d677ad9af0fff9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page