Skip to main content

Datagusto SDK for Python

Project description

Datagusto SDK for Python

This is the official Python SDK for Datagusto AI platform.

Installation

You can install the package using pip:

pip install datagusto-sdk

Quick Start

import os
from datagusto.callback import LangchainCallbackHandler

# Initialize the handler
os.environ["DATAGUSTO_SECRET_KEY"] = "sk-dg-xxxxx"
handler = LangchainCallbackHandler()

# Integrate the handler into your agent
from typing import Annotated
from langchain_openai import ChatOpenAI
from langchain_core.messages import HumanMessage
from typing_extensions import TypedDict
from langgraph.graph import StateGraph
from langgraph.graph.message import add_messages

class State(TypedDict):
    messages: Annotated[list, add_messages]
 
graph_builder = StateGraph(State)
 
llm = ChatOpenAI(model = "gpt-4o-mini", temperature = 0.2)
 
def chatbot(state: State):
    return {"messages": [llm.invoke(state["messages"])]}
 
graph_builder.add_node("chatbot", chatbot)
graph_builder.set_entry_point("chatbot")
graph_builder.set_finish_point("chatbot")
graph = graph_builder.compile().with_config({"callbacks": [handler]})
 
for s in graph.stream({"messages": [HumanMessage(content = "What is autonomous AI agent?")]}):
    print(s)

Requirements

  • Python 3.12 or later
  • Dependencies:
    • langchain>=0.3.21
    • langchain-core>=0.3.48

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

datagusto_dev_sdk-0.1.2.tar.gz (30.6 kB view details)

Uploaded Source

Built Distribution

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

datagusto_dev_sdk-0.1.2-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file datagusto_dev_sdk-0.1.2.tar.gz.

File metadata

  • Download URL: datagusto_dev_sdk-0.1.2.tar.gz
  • Upload date:
  • Size: 30.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for datagusto_dev_sdk-0.1.2.tar.gz
Algorithm Hash digest
SHA256 17ccbb57b1cc55109fc4c626dbaf6874e139b0bc61955049ce2a4d1e597c3f15
MD5 e4bc3188a9938929f973ed00804ac4e8
BLAKE2b-256 1da3b1ce89046217a7b4d9860a978e977416d1b6c3ec8962f99589f16390b5ba

See more details on using hashes here.

File details

Details for the file datagusto_dev_sdk-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for datagusto_dev_sdk-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9b7fa93ccd0206433d3c4149834228e37fa57d4ff826a7cd53b9d6dd34699072
MD5 c6fe100af6c4c9f12ee95d3cf4303641
BLAKE2b-256 043f5fc0bf1c73e26f8cf2a268139cca2d01d265c8ef7f0466e4e0d225cb8573

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