8000 Added Google Big Query Tool by deepd1534 · Pull Request #3141 · agno-agi/agno · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Added Google Big Query Tool #3141

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

deepd1534
Copy link

Summary

Added Google Big Query Tool for querying across Big Query Datasets

Type of change

  • ✅ New feature

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 with name bigquery_tools.py
  • ✅ Tested in clean environment

@deepd1534 deepd1534 requested a review from a team as a code owner May 9, 2025 15:48
@deepd1534
Copy link
Author

Hi Folks, do review this feature, This tool streamlines querying across datasets in Google Cloud BigQuery, making data exploration seamless.

Copy link
Contributor
@dirkbrnd dirkbrnd left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution! Mind adding some unit tests? Please see how we tested the other google tools

ashpreetbedi and others added 13 commits May 11, 2025 11:33
## Summary

Basic implementation of Langfuse using OpenLit

## Type of change

- [ ] Bug fix
- [x] 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

Add any important context (deployment instructions, screenshots,
security considerations, etc.)
## Summary

update reasoning tools cookbook with ibm-watsonx

(If applicable, issue number: #____)

## Type of change

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

---

## 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

Add any important context (deployment instructions, screenshots,
security considerations, etc.)
## Summary

Web search support for Claude

(If applicable, issue number: #____)

## Type of change

- [ ] Bug fix
- [x] 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

Add any important context (deployment instructions, screenshots,
security considerations, etc.)

---------

Co-authored-by: Dirk Brand <dirkbrnd@gmail.com>
## Summary

Keep track of the current user ID and current session ID to use in tools

## Type of change

- [ ] Bug fix
- [x] 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

Add any important context (deployment instructions, screenshots,
security considerations, etc.)

---------

Co-authored-by: Kaustubh <shuklakaustubh84@gmail.com>
## Summary

Manual user passed filters:
```py
knowledge_base = PDFUrlKnowledgeBase(
    urls=[
        {
            "https://agno-public.s3.amazonaws.com/recipes/ThaiRecipes.pdf": {
                "metadata": {
                    "user_id": "user_2",
                    "source": "Cape Cookbook",
                }
            }
        },
        {
            "https://agno-public.s3.amazonaws.com/recipes/ThaiRecipes.pdf": {
                "metadata": {
                    "user_id": "user_2",
                    "source": "Cape Cookbook",
                }
            }
        },
    ],
    vector_db=vector_db,
    reader=PDFUrlReader(chunk=True),
)
knowledge_base.load()

agent = Agent(
    knowledge=knowledge_base,
    search_knowledge=True,
    knowledge_filters={"user_id": "jordan_mitchell"},
)
```

Agentic filters:
```py
agent = Agent(
    knowledge=knowledge_base,
    search_knowledge=True,
    enable_agentic_filters=True,
)

agent.print_response(
    "Tell me about Jordan Mitchell's experience and skills with user id as jordan_mitchell and document type cv and year as 2025",
    markdown=True,
)
```

The agent automatically figures out which filters to use and applies-

![image](https://github.com/user-attachments/assets/48b98a67-a996-4af1-8797-08b9fb837808)


(If applicable, issue number: #____)

## Type of change

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

---

## Checklist

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

---

## Additional Notes

Add any important context (deployment instructions, screenshots,
security considerations, etc.)

---------

Co-authored-by: Dirk Brand <dirkbrnd@gmail.com>
Co-authored-by: Yash Pratap Solanky <101447028+ysolanky@users.noreply.github.com>
Co-authored-by: Dirk Brand <51947788+dirkbrnd@users.noreply.github.com>
## Summary

Describe key changes, mention related issues or motivation for the
changes.

(If applicable, issue number: #____)

## 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)

---

##
8000
 Additional Notes

Add any important context (deployment instructions, screenshots,
security considerations, etc.)

---------

Co-authored-by: Dirk Brand <dirkbrnd@gmail.com>
## Summary

Describe key changes, mention related issues or motivation for the
changes.

(If applicable, issue number: #____)

## 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

Add any important context (deployment instructions, screenshots,
security considerations, etc.)
# Changelog

## New Features:

- **Cerebras Model Provider**: Added Cerebras as a model provider.
- **Claude Web Search**: Added support for [Claude’s new web search
tool](https://www.anthropic.com/news/web-search)
- **Knowledge Base Metadata Filtering (Beta)**: Added support for
filtering documents by metadata
    - **Two Ways to Apply Filters**:
- **Explicit Filtering**: Pass filters directly to Agent or during
run/query
            
            ```python
            # Option 1: Filters on Agent initialization
            agent = Agent(
            					knowledge=knowledge_base, 
            					knowledge_filters={"filter_1": "abc"}
            				)
                 
            # Option 2: Filters on run execution
agent.run("Tell me about...", knowledge_filters={"filter_1": "abc"})
            ```
            
See docs
[here](https://github.com/agno-agi/agno/blob/main/cookbook/agent_concepts/knowledge/filters/pdf/filtering.py)
            
- **Agentic Filtering**: Agent automatically detects and applies filters
from user queries
            
            ```python
            # Enable automatic filter detection
            agent = Agent(
            					knowledge=knowledge_base, 
            					enable_agentic_knowledge_filters=True
            				)
                 
            # Agent extracts filters from query
            agent.run("Tell me about John Doe's experience...")
            ```
            
See docs
[here](https://github.com/agno-agi/agno/blob/main/cookbook/agent_concepts/knowledge/filters/pdf/agentic_filtering.py)
            
    - Two approaches for adding metadata to documents:
        1. **During Knowledge Base Initialization**:
            
            ```python
            knowledge_base = PDFKnowledgeBase(path=[
                 {
            		     "path": "file_1.pdf", 
            		     "metadata": {
            				     "user_id": "abc"
            				  }
            		 },
            		 {
            		     "path": "file_2.pdf", 
            		     "metadata": {
            				     "user_id": "xyz"
            				  }
            		 }
            ])
            ```
            
        2. **During Individual Document Loading:**
            
            ```python
            knowledge_base.load_document(
                 path="file.pdf",
                 metadata={"user_id": "abc"}
            )
            ```
            
    - **Compatibility**
- **Knowledge Base Types**: `PDF`, `Text`, `DOCX`, `JSON`, and `PDF_URL`
        - **Vector Databases**: `Qdrant`, `LanceDB`, and `MongoDB`

## Improvements:

- **User and Session ID in Tools**: Added `current_user_id` and
`current_session_id` as default variables in

## Bug Fixes:

- **Knowledge Base ID Clashes**: Knowledge files with overlapping
names (e.g., `abc.-.xyz.pdf` and `abc.-.def.pdf`)
were being incorrectly identified due to the readers using formatted
names as unique id which were getting uniqueness conflict. Introduced a
unique ID for each document in all the readers using `uuidv4()` to
ensure strict identification and prevent conflicts.
ag auth is invalid, use ag setup to authenticate.

Co-authored-by: winter chen <winter.chen@maiscrm.com>
@deepd1534
Copy link
Author

Thanks for the contribution! Mind adding some unit tests? Please see how we tested the other google tools

Thanks for the feedback! I've added the unit tests :)

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.

7 participants
0