Skip to content

Conversation

@ron-42
Copy link
Contributor

@ron-42 ron-42 commented Oct 29, 2025

Summary

The synchronous add_contents method was missing the text_contents parameter in its type signature and docstring, while the async add_contents_async method had it correctly defined. This caused confusion and prevented proper IDE autocomplete and type checking when users tried to use knowledge.add_contents(text_contents=[...]).

Key changes:

  • Added text_contents: Optional[List[str]] parameter to the add_contents method overload
  • Added topics, reader, and remote_content parameters for consistency with the async version
  • Updated the docstring to document all newly added parameters

This fix resolves a GitHub issue where users reported that the parameter "contents" in knowledge.add_contents was incorrect and should be "text_contents".

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Improvement
  • Model update
  • Other:

Checklist

  • Code complies with style guidelines
  • Ran format/validation scripts (./scripts/format.sh and ./scripts/validate.sh)
  • Self-review completed
  • Documentation updated (comments, docstrings)
  • Examples and guides: Relevant cookbook examples have been included or updated (if applicable)
  • Tested in clean environment
  • Tests added/updated (if applicable)

Additional Notes

The implementation of add_contents already forwarded all arguments correctly to add_contents_async using *args, **kwargs, so only the type signature and documentation needed updating. No behavior changes were made - this is purely a fix for the public API definition.

Existing cookbook examples in cookbook/knowledge/basic_operations/15_text_content.py already demonstrate correct usage of the text_contents parameter with the async version.

solves #5232

Added text_contents and other missing parameters (topics, reader,
remote_content) to match the async version. Updated docstring accordingly.
@ron-42 ron-42 requested a review from a team as a code owner October 29, 2025 18:33
@dirkbrnd dirkbrnd merged commit da7b099 into agno-agi:main Nov 4, 2025
5 checks passed
s-aravindh pushed a commit to s-aravindh/agno that referenced this pull request Nov 8, 2025
…ture (agno-agi#5239)

## Summary

The synchronous `add_contents` method was missing the `text_contents`
parameter in its type signature and docstring, while the async
`add_contents_async` method had it correctly defined. This caused
confusion and prevented proper IDE autocomplete and type checking when
users tried to use `knowledge.add_contents(text_contents=[...])`.

**Key changes:**
- Added `text_contents: Optional[List[str]]` parameter to the
`add_contents` method overload
- Added `topics`, `reader`, and `remote_content` parameters for
consistency with the async version
- Updated the docstring to document all newly added parameters

This fix resolves a GitHub issue where users reported that the parameter
"contents" in `knowledge.add_contents` was incorrect and should be
"text_contents".

## Type of change

- [x] Bug fix
- [ ] New feature
- [ ] Breaking change
- [ ] Improvement
- [ ] Model update
- [ ] Other:

---

## Checklist

- [x] Code complies with style guidelines
- [ ] Ran format/validation scripts (`./scripts/format.sh` and
`./scripts/validate.sh`)
- [x] Self-review completed
- [x] Documentation updated (comments, docstrings)
- [x] Examples and guides: Relevant cookbook examples have been included
or updated (if applicable)
- [ ] Tested in clean environment
- [ ] Tests added/updated (if applicable)

---

## Additional Notes

The implementation of `add_contents` already forwarded all arguments
correctly to `add_contents_async` using `*args, **kwargs`, so only the
type signature and documentation needed updating. No behavior changes
were made - this is purely a fix for the public API definition.

Existing cookbook examples in
`cookbook/knowledge/basic_operations/15_text_content.py` already
demonstrate correct usage of the `text_contents` parameter with the
async version.

solves agno-agi#5232
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.

2 participants