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.4.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.4-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: QuantileClient-0.4.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.4.tar.gz
Algorithm Hash digest
SHA256 3c115478612365184b1490178fc750ea61f0c5309ac0a038cb62b672417ffbaf
MD5 8f259467647d78056f9f2f4c8060886b
BLAKE2b-256 c85dd89ddb990ca3383172ad70efd61e849bf076692dd1a3104899382df0e1a5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: QuantileClient-0.4-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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 023b2a71dfccf37699838c53935509d4b714b5334227cbbd267080c3ff60c32a
MD5 05334cd604c7019c0a9ba9db84bebc90
BLAKE2b-256 555fb9a7d61fb5b049753c31c4b0822c015a17212aa43c04000f11858d434751

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