Skip to main content

The official Python library for the teraflopai API

Project description

Teraflop AI Python API library

Installation

# install from PyPI
pip install teraflopai

Usage

export TERAFLOPAI_API_KEY="your_api_key_here"

Search Engine API

from teraflopai import TeraflopAI

url = "https://api.caselaw.teraflopai.com/v1/search/free"

client = TeraflopAI(url=url)

results = client.search("City of Houma")

print(results["results"])

Segmentation API

from teraflopai import TeraflopAI

url = "https://api.segmentation.teraflopai.com/v1/segmentation/free"

client = TeraflopAI(url=url)

text = """
UNITED STATES of America, Appellee, v. Daniel Dee VEON, Appellant.
No. 72-1889.
United States Court of Appeals, Ninth Circuit.
Feb. 12, 1973.

Claude 0. Allen, Oakland, Cal., for appellant.
James L. Browning, Jr., U. S. Atty., F. Steele Langford and Jerry K. Cimmet, Asst. U. S. Attys., San Francisco, Cal., for appellee.
Before TRASK, GOODWIN and WALLACE, Circuit Judges.
PER CURIAM:

Daniel Dee Veon appeals from convictions of violations of 21 U.S.C. § 841 (a) (1) (possession of marijuana with intent to distribute); two counts of 21 U.S.C. § 843(b) (use of telephone to commit or to facilitate commission of felonies under Title 21); 21 U.S.C. § 846 (conspiracy to distribute and to possess with intent to distribute marijuana).

Defendant contends the district court erred: (1) in restricting the reeross-examination of a government witness; (2) in receiving into evidence a tape recording and a written transcript of the tape; and (3) in submitting the case to the jury, upon evidence which he asserts was insufficient to support the verdict.

Customs agents observed a load of 400 kilograms of marijuana being brought in from Mexico. The agents arrested the smugglers and had them make a “controlled delivery” to Donald Lynch, their employer. Lynch was arrested and agreed to cooperate with police. With police listening and taping the call, Lynch phoned Veon and told him that the “stuff” was in for “Gary.” Veon said, “Yeah, okay, uh?” Lynch replied, “Same old thing.” Veon signified assent. This call is the basis for the second count of the indictment.
"""

results = client.segment(text)

print(results["results"])

Beta functionality only available upon request

OpenAI compatible API

import os
from openai import OpenAI

client = OpenAI(
    base_url="",
    api_key=os.environ.get("TERAFLOPAI_API_KEY"),
)

response = client.embeddings.create(
    input=[
        "Your text string goes here",
        "Another text string",
    ],
    model=""
)

print(response)

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

teraflopai-0.1.12.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

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

teraflopai-0.1.12-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

Details for the file teraflopai-0.1.12.tar.gz.

File metadata

  • Download URL: teraflopai-0.1.12.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.3

File hashes

Hashes for teraflopai-0.1.12.tar.gz
Algorithm Hash digest
SHA256 a54f0f47d5902b6ef39dec1a1e14fc12ee73b80d08aef8d20f354714dc84594c
MD5 0bc5e68f86e3e028f366f3eddb11983d
BLAKE2b-256 f8c645cd1235c801a0de56bb3272c8919bcce8c221cc0c3d1bee6ed6fa779e47

See more details on using hashes here.

File details

Details for the file teraflopai-0.1.12-py3-none-any.whl.

File metadata

File hashes

Hashes for teraflopai-0.1.12-py3-none-any.whl
Algorithm Hash digest
SHA256 365d52daefb2b246de0b316d0223700ec5d446dd62e61fe620142b5c9db44486
MD5 f50cc10b56012d585da760c788be48f7
BLAKE2b-256 7d8298ff4d66dfb80fd27dcf08ababa45f595e67a829dacfaf4f6e86ceab9bad

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