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

Uploaded Python 3

File details

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

File metadata

  • Download URL: datagusto_dev_sdk-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 13dec561382dc9117471e261bc2aa6bdf3cb4562b1e2b6176e340ef5c775596e
MD5 e6b9c71485460a9d55989b8cc92bc993
BLAKE2b-256 4ecf4dfc6d347596818a7941575dc9adb0c2c7b94b55d9100d672a7571714a54

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for datagusto_dev_sdk-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cb8dfac023754a1cbf160311ac001ed5925c6c6e737b27323e0ca35421af2203
MD5 49600602beddb593a12ea3d4b20d986d
BLAKE2b-256 13151ceb1cbad8fab8d678aadab00d8072936a0430a770e98a18d8f221da2c3e

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