Skip to content

Document high-level ingestion methods#261

Merged
bmerkle merged 1 commit intomicrosoft:mainfrom
gvanrossum:docs
Apr 30, 2026
Merged

Document high-level ingestion methods#261
bmerkle merged 1 commit intomicrosoft:mainfrom
gvanrossum:docs

Conversation

@gvanrossum
Copy link
Copy Markdown
Collaborator

I wanted to add docs for add_messages_streaming and found that add_messages_with_indexing also wasn't documented. Added both.

@gvanrossum
Copy link
Copy Markdown
Collaborator Author

@bmerkle need your Approval. :-)

@bmerkle bmerkle requested a review from Copilot April 30, 2026 20:23
@bmerkle bmerkle merged commit 0770b26 into microsoft:main Apr 30, 2026
18 checks passed
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the high-level API documentation for ConversationBase ingestion methods so users can understand the recommended message ingestion entrypoints.

Changes:

  • Documented ConversationBase.add_messages_with_indexing method signature and behavior.
  • Documented ConversationBase.add_messages_streaming method signature and intended use case.
  • Minor wording/formatting tweaks in docs/high-level-api.md.

Comment thread docs/high-level-api.md
Comment on lines 22 to +23
timestamp: str | None = None, # ISO timestamp in UTC with 'z' suffix
metadata: ConversationMessageMeta, # See below
metadata: ConversationMessageMeta, # See below
Copy link

Copilot AI Apr 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docs say the timestamp uses a UTC 'z' suffix (lowercase), but the implementation uses an explicit 'Z' suffix (uppercase) for UTC (see format_timestamp_utc and ConversationMessage.timestamp docs). This example format should be updated to avoid generating/accepting the wrong timestamp format.

Copilot uses AI. Check for mistakes.
Comment thread docs/high-level-api.md
`typeagent.create_conversation` described below.

It has one public method:
It has these public methods:
Copy link

Copilot AI Apr 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The doc now says ConversationBase “has these public methods”, but ConversationBase also exposes other non-underscored methods (e.g., create and add_metadata_to_index). Either document these as well or adjust the wording to avoid implying the list is exhaustive.

Suggested change
It has these public methods:
Some of its public methods are:

Copilot uses AI. Check for mistakes.
Comment thread docs/high-level-api.md
```

Adds messages and updates all indexes in a single transaction.
For SQLite storage this is all-or-nothing.
Copy link

Copilot AI Apr 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add_messages_with_indexing is documented as “all-or-nothing” for SQLite, but the implementation explicitly notes that in-memory storage has no rollback support and partial changes may remain on error. Consider adding a brief note about the in-memory behavior here so callers don’t assume transactional semantics when dbname=None.

Suggested change
For SQLite storage this is all-or-nothing.
For SQLite storage this is all-or-nothing. When using in-memory
storage (`dbname=None`), rollback is not supported, so partial
changes may remain if an error occurs.

Copilot uses AI. Check for mistakes.
Comment thread docs/high-level-api.md
```

Adds messages from an async stream, committing each batch separately.
Useful for very large ingestions where one large transaction is impractical.
Copy link

Copilot AI Apr 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add_messages_streaming also performs source-id based skipping (already-ingested messages are silently skipped when source_id is set). This affects messages_added vs. the number of streamed messages; consider documenting this behavior since it’s an important semantic difference from naive “stream + commit” ingestion.

Suggested change
Useful for very large ingestions where one large transaction is impractical.
Useful for very large ingestions where one large transaction is impractical.
When source-id based deduplication is enabled, messages that were already
ingested may be silently skipped during streaming. As a result,
`AddMessagesResult.messages_added` may be smaller than the total number of
messages yielded by the async iterable.

Copilot uses AI. Check for mistakes.
@gvanrossum gvanrossum deleted the docs branch May 1, 2026 05:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants