-
Notifications
You must be signed in to change notification settings - Fork 0
Feat/adk hello world #2
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| # GEMINI.md | ||
|
|
||
| We use Python 3.12 and uv for dependency management. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| from google.adk import Agent | ||
|
|
||
| # Create a simple agent | ||
| hello_agent = Agent( | ||
| name='hello_agent', | ||
| instruction='You are a friendly agent that says "Hello, World!".' | ||
| ) | ||
|
|
||
| # Interact with the agent | ||
| response = hello_agent.process('Say hi') | ||
|
|
||
| # Print the response | ||
| print(response.text) | ||
|
Comment on lines
+1
to
+13
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The script's logic is currently in the global scope. It's a best practice in Python to encapsulate the main logic in a function (e.g., from google.adk import Agent
def main():
"""Runs the hello world agent."""
# Create a simple agent
hello_agent = Agent(
name='hello_agent',
instruction='You are a friendly agent that says "Hello, World!".'
)
# Interact with the agent
response = hello_agent.process('Say hi')
# Print the response
print(response.text)
if __name__ == "__main__":
main() |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| from fastapi import FastAPI | ||
|
|
||
| app = FastAPI() | ||
|
|
||
| @app.get("/") | ||
| def read_root(): | ||
| return {"Hello": "World"} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| fastapi | ||
| uvicorn |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The heading
# GEMINI.mdis redundant since it's the same as the filename. It's also a good practice for text files to end with a newline for POSIX compatibility and to avoid issues with some tools.