google / google/adk-docs

Docs: updating the import code for example for "ReadonlyContext" at "The Different types of Context"

Open
#540 4 comments 0 reactions 1 assignee Claimed by @joefernandez View on GitHub
Dominant language
Shell
Stars
1.5k
Forks
1.3k
Avg merge
7d 1h
Merged PRs (30d)
34

Description

in this doc section at https://google.github.io/adk-docs/context/#the-different-types-of-context

in the section 2. ReadonlyContext the cod snipet is:

```
# Pseudocode: Instruction provider receiving ReadonlyContext
from google.adk.agents import ReadonlyContext

def my_instruction_provider(context: ReadonlyContext) -> str:
# Read-only access example
user_tier = context.state().get("user_tier", "standard") # Can read state
# context.state['new_key'] = 'value' # This would typically cause an error or be ineffective
return f"Process the request for a {user_tier} user."
```

however the import for the ReadonlyContext needs to get updated to:

`from google.adk.agents.readonly_context import ReadonlyContext`

you can see the current code at this image

Image

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.