Skip to main content

Its a wrapper lib from quantile ai api service

Project description

QuantileClientLib

QuantileClient is a Python client library designed to serve as a wrapper for the Quantile AI API. It simplifies the process of interacting with Quantile's AI supported platfroms LLMs, enabling developers to seamlessly integrate Quantile's capabilities into their Python applications.

All New Rag Chat

Introducing Rag Chat 1.0 – your go-to solution for seamless file uploads and effortless chatting! No more cumbersome links or complicated interfaces. It's as easy as upload, chat, and connect.

With Rag Chat 1.0, simplicity is key. Just upload your files with a click and dive straight into conversation. No more endless waiting for links to load or struggling with tangled chains of language Simple effictive Easy to integrate

pip install QuantileClient

File upload

from QuantileClient import QuantileClient

base_url = "http://<api url>"  # Replace with quantileai api base URL
api_key = "<your-api-quant-api-key>"

client = QuantileClient(base_url, api_key)

rag_upload = client.rag_data_upload(
    db_name = "mytest",  #name the db here always remember this
    pdf_file ="test2.pdf", #path to pdf
    chunk_size=100, 
    chunk_overlap=10,
    embedding_model="text-embedding-3-small",
)
print(rag_upload)

Rag Chat

from QuantileClient import QuantileClient

base_url = "http://<api url>"  # Replace with quantileai api base URL
api_key = "<your-api-quant-api-key>"

client = QuantileClient(base_url, api_key)

rag_assitant = client.rag_chat(
    db_name="mytest",
    description="talk in slang", #give deep desc for how it will act
    question = "My question is why quantILE Ai is soo cool",
    #embedding_model="text-embedding-3-small",
    #inference_model="gpt-3.5-turbo-0125",
    #temperature=0
)
print(rag_assitant)
from QuantileClient import QuantileClient

base_url = "http://<api url>"  # Replace with quantileai api base URL
api_key = "<your-api-quant-api-key>"

client = QuantileClient(base_url, api_key)
prompt = "what is an api"

# use any platform and model just change the func
openai_response = client.generate_openai_response(
        model="gpt-3.5-turbo-0125",
        messages=[{"role": "system", "content": prompt},
                  ],
        max_tokens=100,
        parsed_output=True #to give just the output not whole response

    )

anthropic_response = client.generate_anthropic_response(
        model="claude-2.1",
        messages=[{"role": "system", "content": prompt},
                  ],
        max_tokens=100,
        parsed_output=True #to give just the output not whole response

    )

cohere_respose = client.generate_cohere_response(
        max_tokens=100,
        message = prompt , 
        chat_history=[
            {"role": "CHATBOT", "message": "you are an api expert"}
            ]
        connectors=[{"id": "web-search"}]
    )


print(f"My openai response is {openai_response}")
print(f"My cohere response is {cohere_response}")
print(f"My anthropic response is {anthropic_response}")

Access call cascading api

from QuantileClient import QuantileClient

base_url = "http://<api url>"  # Adjust to quantile api base URL
api_key = "<your-api-quant-api-key>"

client = QuantileClient(base_url, api_key)
prompt = "what is an api"

# No neeed to specify model 

callcascade = client.call_cascading(
    prompt="tell me the word news and something abt apis",
    max_tokens=100,
    parsed_output=True #to give just the output not whole response

    
)
print(f"My callcascade response is {callcascade}")

Generate AI Images

from QuantileClient import QuantileClient

base_url = "http://<api url>"  # Adjust to quantile api base URL
api_key = "<your-api-quant-api-key>"

client = QuantileClient(base_url, api_key)
prompt = "ai robots controlling the whole world"

image_gen_response = client.image_gen(
    prompt=prompt,
    model = "dall-e-2",
    width=1024,
    height=1024,
    num_images=1,
    quality="Standard"
    )
print(f"My image gen response is {image_gen_response}")

License

MIT

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

QuantileClient-0.3.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

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

QuantileClient-0.3-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file QuantileClient-0.3.tar.gz.

File metadata

  • Download URL: QuantileClient-0.3.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.1

File hashes

Hashes for QuantileClient-0.3.tar.gz
Algorithm Hash digest
SHA256 d1ab562b7d26bc5b86736acb405d9c4a0340af61cb7a7f65e2d0161232594187
MD5 d5570f41cc3faa4fb43459bb7948ff45
BLAKE2b-256 0bf133f55b2bc73a75fd25ec10890e7bfc375f11eaae76a6da57356e336b1f56

See more details on using hashes here.

File details

Details for the file QuantileClient-0.3-py3-none-any.whl.

File metadata

  • Download URL: QuantileClient-0.3-py3-none-any.whl
  • Upload date:
  • Size: 4.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.1

File hashes

Hashes for QuantileClient-0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 940340263055271c3e4a16edc29b86136c7df51a64ad9a77966048cd92dc545b
MD5 2cde20f6508fbfdd15c8bc7fae2b7e56
BLAKE2b-256 cf0a984a347bd0322a1c37a3898abfa32ebd6148fcc0830fe24505c9d1bcd3a9

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