OpenAI adapter for PULSE Protocol — send PULSE messages, get AI responses
Project description
pulse-openai
OpenAI adapter for PULSE Protocol.
Send PULSE semantic messages, get AI responses. Zero OpenAI boilerplate.
Install
pip install pulse-openai
Quick Start
from pulse import PulseMessage
from pulse_openai import OpenAIAdapter
adapter = OpenAIAdapter(api_key="sk-...")
# Ask a question
msg = PulseMessage(
action="ACT.QUERY.DATA",
parameters={"query": "What is quantum computing?"}
)
response = adapter.send(msg)
print(response.content["parameters"]["result"])
# Analyze sentiment
msg = PulseMessage(
action="ACT.ANALYZE.SENTIMENT",
parameters={"text": "I love this product!"}
)
response = adapter.send(msg)
print(response.content["parameters"]["result"])
Supported Actions
| PULSE Action | What it does | Default Model |
|---|---|---|
ACT.QUERY.DATA |
Ask a question | gpt-4o-mini |
ACT.CREATE.TEXT |
Generate text | gpt-4o |
ACT.ANALYZE.SENTIMENT |
Analyze sentiment | gpt-4o-mini |
ACT.ANALYZE.PATTERN |
Find patterns | gpt-4o |
ACT.TRANSFORM.TRANSLATE |
Translate text | gpt-4o-mini |
ACT.TRANSFORM.SUMMARIZE |
Summarize text | gpt-4o-mini |
Parameters
# Override model
parameters={"query": "...", "model": "gpt-4o"}
# Set temperature
parameters={"query": "...", "temperature": 0.9}
# Limit tokens
parameters={"query": "...", "max_tokens": 500}
# Custom system prompt
parameters={"text": "...", "system_prompt": "You are a helpful assistant."}
# Translation target
parameters={"text": "Hello!", "target_language": "Spanish"}
Why?
Your code speaks PULSE. Today it uses OpenAI. Tomorrow you swap in pulse-anthropic or pulse-local — zero code changes.
# adapter = OpenAIAdapter(api_key="sk-...")
adapter = AnthropicAdapter(api_key="sk-ant-...") # Same code works
License
Apache 2.0
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 pulse_openai-0.1.0.tar.gz.
File metadata
- Download URL: pulse_openai-0.1.0.tar.gz
- Upload date:
- Size: 8.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a0e0c6d7abea4eb5c7356961a6816f6184f4233b0ca0ca1ae0498d714da18510
|
|
| MD5 |
1574ae3253d95f5d378037134b69e5c7
|
|
| BLAKE2b-256 |
ee0d81219be4c53409dd4faa6769344be800630da32440c987b00db5645c08e1
|
File details
Details for the file pulse_openai-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pulse_openai-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
47383625822c1b44c18c4d3d85f716831c6806c37c2867fba2446f7e31708169
|
|
| MD5 |
12630434085f9ddfffe44a93e7492019
|
|
| BLAKE2b-256 |
3490838414c7893fc1ed3007b1a984481d9020475906a08888ce10c9447fc26e
|