seclm
Project description
SecLM library
This library provides convenient access to pin an SSL certificate to a specific pubkey.
Installation
pip install seclm
Usage
Here are some examples of using it in different libraries.
# specify url and sha256
from seclm.ssl import create_ssl_context
ssl_context = create_ssl_context("https://example.seclm.com", "9e69296bf68815839e2cf5c324318f304ba8a7de2f587245c0cb75f54e3fe196")
# httpx
import httpx
httpx.get("https://example.seclm.com", verify=ssl_context)
# aiohttp
import asyncio
import aiohttp
async def main():
async with aiohttp.ClientSession() as session:
async with session.get("https://example.seclm.com", ssl=ssl_context) as response:
await response.text()
asyncio.run(main())
# openai
from openai import OpenAI, DefaultHttpxClient
client = OpenAI(
api_key="EMPTY",
base_url="https://example.seclm.com/v1",
http_client=DefaultHttpxClient(verify=ssl_context)
)
chat_completion = client.chat.completions.create(
messages=[
{
"role": "user",
"content": "Say this is a test",
}
],
model="meta-llama/Meta-Llama-3-8B-Instruct",
)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
seclm-0.1.1.tar.gz
(2.2 kB
view details)
Built Distribution
seclm-0.1.1-py3-none-any.whl
(2.6 kB
view details)
File details
Details for the file seclm-0.1.1.tar.gz
.
File metadata
- Download URL: seclm-0.1.1.tar.gz
- Upload date:
- Size: 2.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c174f20ca8ae6b3a982f908244fb5e682cfd0cfe0ed47ae28cd5fbb42c4a2d55 |
|
MD5 | 5bd2b155f13ba9b11e148a4ba802d37e |
|
BLAKE2b-256 | b6392b1ff6c846b2eaa5be53f1aead05a2c55b0065a9a3bf5f6e0439ed37826b |
File details
Details for the file seclm-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: seclm-0.1.1-py3-none-any.whl
- Upload date:
- Size: 2.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e4f251080150a36ebf40cc6dd8ec298afcd5d3fe8f1ca619714a5f33e0dcdb89 |
|
MD5 | 42da6a2e2bf728791c34b4477e8f6f61 |
|
BLAKE2b-256 | 1ba41ae6fc33ead291c1b6b54f4d6b125c16c946ccc48168ebb406e4c822b4cf |