fix: removing message_count
This commit is contained in:
parent
85abc45e3a
commit
55d03e335b
|
|
@ -8,7 +8,7 @@ from typing import Optional
|
|||
import typer
|
||||
|
||||
from honcho_cli.commands.workspace import _handle_error
|
||||
from honcho_cli.output import print_error, print_result, status
|
||||
from honcho_cli.output import print_error, print_result, status, use_json
|
||||
from honcho_cli.validation import validate_resource_id
|
||||
|
||||
from honcho_cli.common import add_common_options
|
||||
|
|
@ -51,7 +51,7 @@ def list_conclusions(
|
|||
items = [
|
||||
{
|
||||
"id": c.id,
|
||||
"content": c.content[:200],
|
||||
"content": c.content if use_json() else c.content[:200],
|
||||
"workspace_id": config.workspace_id,
|
||||
"observer_id": c.observer_id,
|
||||
"observed_id": c.observed_id,
|
||||
|
|
@ -100,7 +100,7 @@ def search(
|
|||
items = [
|
||||
{
|
||||
"id": c.id,
|
||||
"content": c.content[:200],
|
||||
"content": c.content if use_json() else c.content[:200],
|
||||
"workspace_id": config.workspace_id,
|
||||
"observer_id": c.observer_id,
|
||||
"observed_id": c.observed_id,
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ from typing import Optional
|
|||
import typer
|
||||
|
||||
from honcho_cli.commands.workspace import _config_to_dict, _handle_error
|
||||
from honcho_cli.output import print_result
|
||||
from honcho_cli.output import print_result, use_json
|
||||
from honcho_cli.validation import validate_resource_id
|
||||
|
||||
from honcho_cli.common import add_common_options
|
||||
|
|
@ -93,7 +93,7 @@ def inspect(
|
|||
"session_count": session_page.total if session_page.total is not None else len(session_items),
|
||||
"conclusion_count": conclusion_page.total if conclusion_page.total is not None else len(conclusion_items),
|
||||
"recent_conclusions": [
|
||||
{"id": c.id, "content": c.content[:200], "created_at": str(c.created_at)}
|
||||
{"id": c.id, "content": c.content if use_json() else c.content[:200], "created_at": str(c.created_at)}
|
||||
for c in conclusion_items
|
||||
],
|
||||
"sessions": [{"id": s.id} for s in session_items[:10]],
|
||||
|
|
@ -175,7 +175,7 @@ def search(
|
|||
items = [
|
||||
{
|
||||
"id": m.id,
|
||||
"content": m.content[:200],
|
||||
"content": m.content if use_json() else m.content[:200],
|
||||
"session_id": m.session_id,
|
||||
"created_at": str(m.created_at),
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ from typing import List, Optional
|
|||
import typer
|
||||
|
||||
from honcho_cli.commands.workspace import _config_to_dict, _handle_error
|
||||
from honcho_cli.output import print_result, status
|
||||
from honcho_cli.output import print_result, status, use_json
|
||||
from honcho_cli.validation import validate_resource_id
|
||||
|
||||
from honcho_cli.common import add_common_options
|
||||
|
|
@ -87,21 +87,10 @@ def inspect(
|
|||
summaries = sess.summaries()
|
||||
sess_config = sess.get_configuration()
|
||||
|
||||
# Use SyncPage.total when the server provides it; otherwise fall back
|
||||
# to the first-page count and flag that we did so, so scripted
|
||||
# callers don't treat a lower bound as a total.
|
||||
if msg_page.total is not None:
|
||||
message_count = msg_page.total
|
||||
message_count_is_total = True
|
||||
else:
|
||||
message_count = len(msg_page.items)
|
||||
message_count_is_total = False
|
||||
|
||||
result = {
|
||||
"session_id": sid,
|
||||
"peers": [{"id": p.id} for p in peers],
|
||||
"message_count": message_count,
|
||||
"message_count_is_total": message_count_is_total,
|
||||
"message_count": msg_page.total,
|
||||
"summaries": {
|
||||
"short": summaries.short_summary if hasattr(summaries, "short_summary") else None,
|
||||
"long": summaries.long_summary if hasattr(summaries, "long_summary") else None,
|
||||
|
|
@ -314,7 +303,7 @@ def search(
|
|||
{
|
||||
"id": m.id,
|
||||
"peer_id": m.peer_id,
|
||||
"content": m.content[:200],
|
||||
"content": m.content if use_json() else m.content[:200],
|
||||
"created_at": str(m.created_at),
|
||||
}
|
||||
for m in results
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ from typing import Optional
|
|||
|
||||
import typer
|
||||
|
||||
from honcho_cli.output import print_error, print_result, status
|
||||
from honcho_cli.output import print_error, print_result, status, use_json
|
||||
from honcho_cli.validation import validate_resource_id
|
||||
|
||||
from honcho_cli.common import add_common_options
|
||||
|
|
@ -188,7 +188,7 @@ def search(
|
|||
items = [
|
||||
{
|
||||
"id": m.id,
|
||||
"content": m.content[:200],
|
||||
"content": m.content if use_json() else m.content[:200],
|
||||
"peer_id": m.peer_id,
|
||||
"session_id": m.session_id,
|
||||
"created_at": str(m.created_at),
|
||||
|
|
|
|||
Loading…
Reference in New Issue