Common utilities for OpenRelik AI functionality
Project description
Common utilities for OpenRelik AI functionality.
# LLM providers are configured via environment variables
# export OLLAMA_SERVER_URL=http://localhost:11434
# export OLLAMA_DEFAULT_MODEL=gemma2:9b
from openrelik_ai_common.providers import manager
provider = manager.LLMManager().get_provider("ollama")
llm = provider(model_name="gemma2:9b", system_instructions="Your name is Foobar.")
# Single text generation
response = llm.generate(prompt="Hello, what is your name?")
print(response)
# Multiturn chat session
response = llm.chat("What is your name?")
print(response)
response = llm.chat("My name is John Doe")
print(response)
response = llm.chat("What is my name?")
print(response)
# Chat on the command line
while True:
message = input("Message: ")
response = llm.chat(message)
print(response)
Obligatory Fine Print
This is not an official Google product (experimental or otherwise), it is just code that happens to be owned by Google.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file openrelik_ai_common-0.6.1.tar.gz.
File metadata
- Download URL: openrelik_ai_common-0.6.1.tar.gz
- Upload date:
- Size: 13.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7cb8b90cfb98f02fd80feb08bb950fc89abfa90a4cb9326419f0652930fa7063
|
|
| MD5 |
f80ec0846d64cd5057437d20482e5b79
|
|
| BLAKE2b-256 |
883399601ef33937d584369580d9996be5538b71a7e36115e567cfb3346b029e
|
Provenance
The following attestation bundles were made for openrelik_ai_common-0.6.1.tar.gz:
Publisher:
publish-pypi.yml on openrelik/openrelik-ai-common
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
openrelik_ai_common-0.6.1.tar.gz -
Subject digest:
7cb8b90cfb98f02fd80feb08bb950fc89abfa90a4cb9326419f0652930fa7063 - Sigstore transparency entry: 1667188725
- Sigstore integration time:
-
Permalink:
openrelik/openrelik-ai-common@4683898d57eb325b8e6f751afe8a038b7d53f0a4 -
Branch / Tag:
refs/tags/0.6.1 - Owner: https://github.com/openrelik
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@4683898d57eb325b8e6f751afe8a038b7d53f0a4 -
Trigger Event:
release
-
Statement type:
File details
Details for the file openrelik_ai_common-0.6.1-py3-none-any.whl.
File metadata
- Download URL: openrelik_ai_common-0.6.1-py3-none-any.whl
- Upload date:
- Size: 22.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ba8977a11038287b5b00874cb3d086730785f074228a115ba2857d93aea2a9d9
|
|
| MD5 |
7dd2eb86c7de0f13c6eb1f0bd8e8315d
|
|
| BLAKE2b-256 |
6ae0fca71f8c9158893abd5253111710728911157df21fb7587fcab1d4336e7a
|
Provenance
The following attestation bundles were made for openrelik_ai_common-0.6.1-py3-none-any.whl:
Publisher:
publish-pypi.yml on openrelik/openrelik-ai-common
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
openrelik_ai_common-0.6.1-py3-none-any.whl -
Subject digest:
ba8977a11038287b5b00874cb3d086730785f074228a115ba2857d93aea2a9d9 - Sigstore transparency entry: 1667188790
- Sigstore integration time:
-
Permalink:
openrelik/openrelik-ai-common@4683898d57eb325b8e6f751afe8a038b7d53f0a4 -
Branch / Tag:
refs/tags/0.6.1 - Owner: https://github.com/openrelik
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@4683898d57eb325b8e6f751afe8a038b7d53f0a4 -
Trigger Event:
release
-
Statement type: