Skip to main content

Integration SDK for vishwa.ai

Project description

Welcome to vishwa.ai 👋

vishwa-ml-sdk

Twitter Follow Discord

PyPI version GitHub version

Roadmap 🚀

Framework Status
Langchain
LLamaIndex Planned
PyTorch Planned
SKLearn Planned
Transformers Planned
Stable Diffusion Next

💡 If support of any framework/feature is useful for you, please feel free to reach out to us via Discord or Github Discussions

🔗 Installation

  1. Install from PyPI
pip install vishwa-ml-sdk

🧩 Usage Example

from vishwa.mlmonitor.langchain.instrument import LangchainTelemetry
import os
import vishwa
from vishwa.prompt_hub import PromptClient

# Enable this for advance tracking with our vishwa-ai platform
vishwa.host_url = "https://api.vishwa.ai"
vishwa.api_key = "********************"  # Get from https://platform.vishwa.ai
vishwa.adv_tracing_enabled = "true" # Enable this for automated insights and log tracing via xpulsAI platform
# Add default labels that will be added to all captured metrics
default_labels = {"service": "ml-project-service", "k8s_cluster": "app0", "namespace": "dev", "agent_name": "fallback_value"}

# Enable the auto-telemetry
LangchainTelemetry(default_labels=default_labels,).auto_instrument()
prompt_client = PromptClient(   
    prompt_id="clrfm4v70jnlb1kph240",  # Get prompt_id from the platform
    environment_name="dev"  # Deployed environment name
)

## [Optional] Override labels for scope of decorator [Useful if you have multiple scopes where you need to override the default label values]
@TelemetryOverrideLabels(agent_name="chat_agent_alpha")
@TagToProject(project_slug="defaultoPIt9USSR")  # Get Project Slug from platform
def get_response_using_agent_alpha(prompt, query):
    agent = initialize_agent(llm=chat_model,
                             verbose=True,
                             agent=CONVERSATIONAL_REACT_DESCRIPTION,
                             memory=memory)
    
    data = prompt_client.get_prompt({"variable-1": "I'm the first variable"})  # Substitute any variables in prompt

    res = agent.run(data) # Pass the entire `XPPrompt` object to run or invoke method

ℹ️ Complete Usage Guides

🧾 License

This project is licensed under the Apache License 2.0. See the LICENSE file for more details.

📢 Contributing

We welcome contributions to xpuls-ml-sdk! If you're interested in contributing.

If you encounter any issues or have feature requests, please file an issue on our GitHub repository.

💬 Get in touch

👉 Join our Discord community!

🐦 Follow the latest from vishwa.ai team on Twitter @vishwa_ai

📮 Write to us at hello@vishwa.ai

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

vishwa-ml-sdk-0.4.0.tar.gz (22.5 kB view details)

Uploaded Source

Built Distribution

vishwa_ml_sdk-0.4.0-py3-none-any.whl (30.3 kB view details)

Uploaded Python 3

File details

Details for the file vishwa-ml-sdk-0.4.0.tar.gz.

File metadata

  • Download URL: vishwa-ml-sdk-0.4.0.tar.gz
  • Upload date:
  • Size: 22.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for vishwa-ml-sdk-0.4.0.tar.gz
Algorithm Hash digest
SHA256 c13915b859e4a89b77b12e291847913c04f3053f7f5357146117f10795f72a22
MD5 0d2e60c1f23202322217ceb5aa9e5e91
BLAKE2b-256 0f79987ceb597488f6d2f6fc1b309b42590c1ae9768ef22d9e58e5a510b8f39b

See more details on using hashes here.

File details

Details for the file vishwa_ml_sdk-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for vishwa_ml_sdk-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6e99cc461cbc1d2f1c4abbabd6fb892b29605f3bc7e11f22f33e065b4c3b9ab4
MD5 c5e5924256f159327863b82022bd9fc1
BLAKE2b-256 46a7ee8c5f82c74efed4d1f04ae2c7fb9a95011ce1465681efa78439ca7b6ccf

See more details on using hashes here.

Supported by

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