mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-14 09:46:03 +00:00
Compare commits
5 Commits
fix/litell
...
codex/web-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
516371a6c1 | ||
|
|
4f8e2496d2 | ||
|
|
2e7978317c | ||
|
|
b7d8332cb0 | ||
|
|
7fe3eedeea |
@@ -1,6 +1,6 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "langbot"
|
name = "langbot"
|
||||||
version = "4.10.1"
|
version = "4.10.2"
|
||||||
description = "Production-grade platform for building agentic IM bots"
|
description = "Production-grade platform for building agentic IM bots"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
license-files = ["LICENSE"]
|
license-files = ["LICENSE"]
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
"""LangBot - Production-grade platform for building agentic IM bots"""
|
"""LangBot - Production-grade platform for building agentic IM bots"""
|
||||||
|
|
||||||
__version__ = '4.10.1'
|
__version__ = '4.10.2'
|
||||||
|
|||||||
@@ -202,6 +202,16 @@ class LoadConfigStage(stage.BootingStage):
|
|||||||
constants.instance_id = new_id
|
constants.instance_id = new_id
|
||||||
constants.edition = ap.instance_config.data.get('system', {}).get('edition', 'community')
|
constants.edition = ap.instance_config.data.get('system', {}).get('edition', 'community')
|
||||||
|
|
||||||
|
# Instance creation timestamp: sourced from data/labels/instance_id.json.
|
||||||
|
# Instances created before this field existed (or supplied via
|
||||||
|
# system.instance_id) won't have it, so backfill with the current time
|
||||||
|
# and persist it via the dump below — from then on it stays stable.
|
||||||
|
instance_create_ts = ap.instance_id.data.get('instance_create_ts', 0)
|
||||||
|
if not isinstance(instance_create_ts, int) or instance_create_ts <= 0:
|
||||||
|
instance_create_ts = int(time.time())
|
||||||
|
ap.instance_id.data['instance_create_ts'] = instance_create_ts
|
||||||
|
constants.instance_create_ts = instance_create_ts
|
||||||
|
|
||||||
print(f'LangBot instance id: {constants.instance_id}')
|
print(f'LangBot instance id: {constants.instance_id}')
|
||||||
print(f'LangBot edition: {constants.edition}')
|
print(f'LangBot edition: {constants.edition}')
|
||||||
|
|
||||||
|
|||||||
@@ -84,6 +84,18 @@ class WebPageBotAdapter(abstract_platform_adapter.AbstractMessagePlatformAdapter
|
|||||||
):
|
):
|
||||||
self.listeners.pop(event_type, None)
|
self.listeners.pop(event_type, None)
|
||||||
|
|
||||||
|
async def is_stream_output_supported(self) -> bool:
|
||||||
|
"""Delegate stream output check to ws_adapter."""
|
||||||
|
if self._ws_adapter is not None:
|
||||||
|
return await self._ws_adapter.is_stream_output_supported()
|
||||||
|
return False
|
||||||
|
|
||||||
|
async def create_message_card(self, message_id: str | int, event: platform_events.MessageEvent) -> bool:
|
||||||
|
"""Delegate create_message_card to ws_adapter."""
|
||||||
|
if self._ws_adapter is not None:
|
||||||
|
return await self._ws_adapter.create_message_card(message_id, event)
|
||||||
|
return False
|
||||||
|
|
||||||
async def is_muted(self, group_id: int) -> bool:
|
async def is_muted(self, group_id: int) -> bool:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|||||||
@@ -109,6 +109,7 @@ async def build_heartbeat_payload(ap: core_app.Application) -> dict:
|
|||||||
'query_id': '',
|
'query_id': '',
|
||||||
'version': constants.semantic_version,
|
'version': constants.semantic_version,
|
||||||
'instance_id': constants.instance_id,
|
'instance_id': constants.instance_id,
|
||||||
|
'instance_create_ts': constants.instance_create_ts,
|
||||||
'edition': constants.edition,
|
'edition': constants.edition,
|
||||||
'features': features,
|
'features': features,
|
||||||
'timestamp': datetime.now(timezone.utc).isoformat(),
|
'timestamp': datetime.now(timezone.utc).isoformat(),
|
||||||
|
|||||||
@@ -16,3 +16,11 @@ debug_mode = False
|
|||||||
edition = 'community'
|
edition = 'community'
|
||||||
|
|
||||||
instance_id = ''
|
instance_id = ''
|
||||||
|
|
||||||
|
instance_create_ts = 0
|
||||||
|
"""Unix timestamp (seconds) of when this instance was first created.
|
||||||
|
|
||||||
|
Sourced from ``data/labels/instance_id.json``. Backfilled to the current
|
||||||
|
time for instances created before this field existed, so it is always a
|
||||||
|
positive value once load_config has run.
|
||||||
|
"""
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ class TestBuildHeartbeatPayload:
|
|||||||
|
|
||||||
assert payload['event_type'] == 'instance_heartbeat'
|
assert payload['event_type'] == 'instance_heartbeat'
|
||||||
assert payload['query_id'] == ''
|
assert payload['query_id'] == ''
|
||||||
|
assert 'instance_create_ts' in payload
|
||||||
assert 'timestamp' in payload
|
assert 'timestamp' in payload
|
||||||
f = payload['features']
|
f = payload['features']
|
||||||
assert f['database'] == 'postgresql'
|
assert f['database'] == 'postgresql'
|
||||||
|
|||||||
Reference in New Issue
Block a user