Add package documentation to all public packages#548
Open
PratikDhanave wants to merge 2 commits into
Open
Conversation
The agent and message packages — the core of the framework — and the OpenAI, Anthropic, and Gemini provider packages had no package-level doc comment, so their pkg.go.dev pages open with no overview (unlike foundryprovider, mcptool, shelltool, and agentworkflow, which do). Add a doc.go with a concise package comment to each, using godoc doc links to the primary entry points. Documentation only; no code changes.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds package-level GoDoc comments (doc.go) to key public packages so their pkg.go.dev pages display a useful overview, bringing them in line with other already-documented packages in the repo.
Changes:
- Added package documentation for core packages
agentandmessage. - Added package documentation for the main provider packages:
provider/openaiprovider,provider/anthropicprovider, andprovider/geminiprovider.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| agent/doc.go | Adds package overview and links to primary agent entry points (Agent.Run*, ResponseStream). |
| message/doc.go | Adds package overview describing the message/content model and JSON marshaling approach. |
| provider/openaiprovider/doc.go | Adds package overview and links to OpenAI agent constructors (NewAgent, NewResponsesAgent, NewChatCompletionsAgent). |
| provider/anthropicprovider/doc.go | Adds package overview and links to NewAgent / AgentConfig. |
| provider/geminiprovider/doc.go | Adds package overview and links to NewAgent / AgentConfig. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Follow-up in this PR covering every remaining public package without a
package doc: agent/compaction, agent/format/jsonformat,
agent/harness/toolautocall, agent/skills(+fsskills), message/messagefilter,
message/messageworkflow, provider/{a2a,agui,copilot,otel}provider, tool
(+agenttool, functool), and workflow (+checkpoint, inproc, observability,
opentelemetry). Every public package now has a package-level overview on
pkg.go.dev. Documentation only.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a package-level doc comment (via a
doc.goper package) to every public package that lacked one — 24 packages in total, so each opens with an overview on pkg.go.dev instead of a bare symbol list.Covers the core (
agent,message), the providers (openai,anthropic,gemini,copilot,a2a,agui,otel), tools (tool,functool,agenttool), workflow (workflow,checkpoint,inproc,observability,opentelemetry), and the remaining agent/message subpackages (compaction,jsonformat,toolautocall,skills,fsskills,messagefilter,messageworkflow).Why
Sibling packages (
foundryprovider,tool/mcptool,tool/shelltool,workflow/agentworkflow) already had package docs; this brings the rest up to the same bar. After this, no public package is missing a package overview.Notes
go build,go vet, andgofmtall clean.[NewAgent],[Agent.Run]) where helpful.doc.gofiles to avoid churn on the primary source files (and conflicts with in-flight PRs).