Include examples in type checking
Remove `examples/` from the `pyrightconfig.json` ignore list and fix
the resulting type errors across all example files. Common fixes:
- Required API keys: `os.getenv("X")` -> `os.environ["X"]` so the
return type is `str` rather than `str | None`, and misconfiguration
fails fast.
- Narrow `LLMContextMessage` union members with `isinstance(..., dict)`
before dict-style access.
- `assert isinstance(params.llm, ...)` before calling service-specific
methods that aren't on the base `LLMService`.
- Guard optional frame fields (e.g. `LLMSearchResponseFrame.search_result`)
before use.
This commit is contained in:
@@ -192,7 +192,7 @@ Remember, your responses should be short - just one or two sentences usually."""
|
||||
)
|
||||
|
||||
llm = GrokRealtimeLLMService(
|
||||
api_key=os.getenv("XAI_API_KEY"),
|
||||
api_key=os.environ["XAI_API_KEY"],
|
||||
session_properties=session_properties,
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user