Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a5a7b29764
|
||
|
|
e2ecbc747d
|
||
|
|
61cb91c490
|
||
|
|
d92b6cb950
|
No files matched your search
+11
-1
@@ -50,10 +50,20 @@ def _shorten_with_claude(text: str, max_chars: int) -> str:
|
|||||||
model="claude-sonnet-4-6",
|
model="claude-sonnet-4-6",
|
||||||
max_tokens=256,
|
max_tokens=256,
|
||||||
timeout=CLAUDE_TIMEOUT_S,
|
timeout=CLAUDE_TIMEOUT_S,
|
||||||
|
system=(
|
||||||
|
"You rewrite a message to fit within a strict character budget. "
|
||||||
|
"Output ONLY the rewritten message — no preamble, no quotes, no "
|
||||||
|
"explanation, no commentary, no labels, no character count. "
|
||||||
|
"Preserve the original meaning, tone, and voice. Plain text only."
|
||||||
|
),
|
||||||
messages=[
|
messages=[
|
||||||
{
|
{
|
||||||
"role": "user",
|
"role": "user",
|
||||||
"content": f"Shorten this to {max_chars} characters: {text}",
|
"content": (
|
||||||
|
f"Rewrite the following message so it is at most "
|
||||||
|
f"{max_chars} characters. Reply with the rewritten "
|
||||||
|
f"message only.\n\n{text}"
|
||||||
|
),
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|||||||
+3
-2
@@ -178,8 +178,9 @@ def connect_and_run(port: str | None) -> None:
|
|||||||
|
|
||||||
boot("Connecting...")
|
boot("Connecting...")
|
||||||
# `dl.connect()` auto-discovers the port, sends GET_INFO, applies
|
# `dl.connect()` auto-discovers the port, sends GET_INFO, applies
|
||||||
# RADIO_CONFIG via SET_CONFIG, and starts the keepalive daemon —
|
# RADIO_CONFIG via SET_CONFIG (with `tx_power_dbm` auto-clamped to
|
||||||
# no manual Ping/SetConfig/StartRx dance required.
|
# the device's PA ceiling — SX1262 caps at 22 dBm, SX1276 PA_BOOST
|
||||||
|
# at 20), and starts the keepalive daemon.
|
||||||
dongle = dl.connect(port=port, timeout=2, config=RADIO_CONFIG)
|
dongle = dl.connect(port=port, timeout=2, config=RADIO_CONFIG)
|
||||||
boot("Connected")
|
boot("Connected")
|
||||||
|
|
||||||
|
|||||||
+5
-5
@@ -52,11 +52,11 @@ RADIO_CONFIG: dl.LoRaConfig = dl.LoRaConfig(
|
|||||||
bw=dl.LoRaBandwidth.KHZ_62_5,
|
bw=dl.LoRaBandwidth.KHZ_62_5,
|
||||||
sf=7,
|
sf=7,
|
||||||
cr=dl.LoRaCodingRate.CR_4_5,
|
cr=dl.LoRaCodingRate.CR_4_5,
|
||||||
sync_word=0x3444,
|
sync_word=0x1424,
|
||||||
tx_power_dbm=22, # DongLoRa Protocol v2 removed the "max power" sentinel; 22 dBm
|
tx_power_dbm=22, # Requested max. `connect_and_run` clamps this down to
|
||||||
# is the SX1262 chip ceiling and the practical upper bound on every
|
# `dongle.info.tx_power_max_dbm` at connect time, so each board
|
||||||
# current DongLoRa board. If you operate a board with a lower cap,
|
# transmits at its own PA ceiling (SX1262: 22 dBm, SX1276 PA_BOOST:
|
||||||
# lower this (or read `d.info.tx_power_max_dbm` and rebuild the config).
|
# 20 dBm, …) without needing a per-board config table here.
|
||||||
preamble_len=16,
|
preamble_len=16,
|
||||||
header_mode=dl.LoRaHeaderMode.EXPLICIT,
|
header_mode=dl.LoRaHeaderMode.EXPLICIT,
|
||||||
payload_crc=True,
|
payload_crc=True,
|
||||||
|
|||||||
@@ -256,6 +256,7 @@ _BUILTIN_HASHTAG_CHANNELS: tuple[str, ...] = (
|
|||||||
"#weather",
|
"#weather",
|
||||||
"#protest",
|
"#protest",
|
||||||
# --- Dev / testing ---
|
# --- Dev / testing ---
|
||||||
|
"#development",
|
||||||
"#devtest",
|
"#devtest",
|
||||||
"#devtestdevtest",
|
"#devtestdevtest",
|
||||||
)
|
)
|
||||||
|
|||||||
+1
-1
@@ -6,7 +6,7 @@ license = "MIT"
|
|||||||
requires-python = ">=3.10"
|
requires-python = ">=3.10"
|
||||||
authors = [{ name = "Stephen Waits" }]
|
authors = [{ name = "Stephen Waits" }]
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"donglora>=1.0.0,<2.0.0",
|
"donglora>=1.1.0,<2.0.0",
|
||||||
"anthropic",
|
"anthropic",
|
||||||
"cobs",
|
"cobs",
|
||||||
"pyserial",
|
"pyserial",
|
||||||
|
|||||||
@@ -178,7 +178,7 @@ wheels = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "donglora"
|
name = "donglora"
|
||||||
version = "1.0.0"
|
version = "1.1.0"
|
||||||
source = { editable = "../client-py" }
|
source = { editable = "../client-py" }
|
||||||
dependencies = [
|
dependencies = [
|
||||||
{ name = "cobs" },
|
{ name = "cobs" },
|
||||||
|
|||||||
Reference in new issue
Block a user