Skip to main content

Utilities for managing multi-shot conversations and structured data handling in LLM applications

This project has been archived.

The maintainers of this project have marked this project as archived. No new releases are expected.

Project description

mdi-llmkit

Utilities for managing LLM chat conversations and structured JSON responses with OpenAI's Responses API.

Installation

pip install mdi-llmkit

Quick Start

gpt_submit

from openai import OpenAI
from mdi_llmkit.gpt_api.functions import gpt_submit

client = OpenAI()

reply = gpt_submit(
    messages=[{"role": "user", "content": "Say hello."}],
    openai_client=client,
)
print(reply)

GptConversation

from openai import OpenAI
from mdi_llmkit.gpt_api.gpt_conversation import GptConversation

client = OpenAI()
conversation = GptConversation(openai_client=client)

reply = conversation.submit_user_message("Give me three project name ideas.")
print(reply)

JSON Response Mode

from openai import OpenAI
from mdi_llmkit.gpt_api.functions import gpt_submit

client = OpenAI()

result = gpt_submit(
    messages=[{"role": "user", "content": "Return JSON with keys a and b."}],
    openai_client=client,
    json_response=True,
)

print(type(result))  # dict or list
print(result)

Notes

  • Package name for pip install is mdi-llmkit.
  • Python import package is mdi_llmkit.
  • gpt_submit supports optional warning reporting via warning_callback.

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

mdi_llmkit-0.1.0.tar.gz (17.2 kB view details)

Uploaded Source

Built Distribution

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

mdi_llmkit-0.1.0-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

Details for the file mdi_llmkit-0.1.0.tar.gz.

File metadata

  • Download URL: mdi_llmkit-0.1.0.tar.gz
  • Upload date:
  • Size: 17.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for mdi_llmkit-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7e1ce7b73308ac3d0fe9351ad58f543b651eea34f71ab9adab71a5bee923c969
MD5 387e4c8e9de45584ad252a1477bffc50
BLAKE2b-256 8a39c570d128318140c528f2970700425677e26f0e84771533993bf13b2222ed

See more details on using hashes here.

File details

Details for the file mdi_llmkit-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: mdi_llmkit-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for mdi_llmkit-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 775281c692feb8d11531c2b385e78256b3556b8760cd9921ba59a33586924542
MD5 edfe3f506207de56cb4da88c422e3992
BLAKE2b-256 7504a769425f3cf8f536b3fe52ca3605d4bc982f508414240ad25a798c7b8209

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