OpenAI adapter for PULSE Protocol — talk to GPT with semantic messages.
Send PULSE semantic messages, get AI responses. Zero OpenAI boilerplate. Same code works with Anthropic, Binance, Bybit — just change one line.
pip install pulse-openaifrom 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"])# from pulse_openai import OpenAIAdapter as Adapter
from pulse_anthropic import AnthropicAdapter as Adapter
adapter = Adapter(api_key="...")Your code stays exactly the same. Only the import changes.
| 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 |
msg = PulseMessage(
action="ACT.ANALYZE.SENTIMENT",
parameters={"text": "I love this product!"}
)
response = adapter.send(msg)msg = PulseMessage(
action="ACT.CREATE.TEXT",
parameters={
"text": "Write a haiku about AI",
"model": "gpt-4o",
"temperature": 0.9,
"max_tokens": 500,
}
)
response = adapter.send(msg)msg = PulseMessage(
action="ACT.TRANSFORM.TRANSLATE",
parameters={"text": "Hello, world!", "target_language": "Spanish"}
)
response = adapter.send(msg)| Parameter | Description | Default |
|---|---|---|
model |
Override the default model | per-action |
temperature |
Creativity (0.0 - 2.0) | 0.7 |
max_tokens |
Max response length | 1000 |
system_prompt |
Custom system instruction | per-action |
target_language |
For translation action | required |
pytest tests/ -q # All tests mocked, no API key needed| Package | Provider | Install |
|---|---|---|
| pulse-protocol | Core | pip install pulse-protocol |
| pulse-openai | OpenAI | pip install pulse-openai |
| pulse-anthropic | Anthropic | pip install pulse-anthropic |
| pulse-binance | Binance | pip install pulse-binance |
| pulse-bybit | Bybit | pip install pulse-bybit |
| pulse-kraken | Kraken | pip install pulse-kraken |
| pulse-okx | OKX | pip install pulse-okx |
| pulse-gateway | Gateway | pip install pulse-gateway |
Apache 2.0 — open source, free forever.