-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(py/reflection-api): use starlette to implement the reflection api …
…#1705 Fixes to server response, logging, middeware, preamble, etc. ISSUE: #1705 CHANGELOG: - [x] Switch the reflection API server to use starlette. - [ ] Use multiprocessing to start background jobs - [ ] Log asynchronously in a structured format using structlog - [ ] Add tests for the reflection API server - [ ] Test against the genkit CLI runtime. - [ ] Update schema to match. - [ ] Make the server configurable.
- Loading branch information
Showing
21 changed files
with
1,197 additions
and
563 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/usr/bin/env python3 | ||
# | ||
# Copyright 2025 Google LLC | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
from genkit.core.action import ActionKind | ||
|
||
|
||
def test_action_enum_behaves_like_str() -> None: | ||
"""Ensure the ActionType behaves like a string and to ensure we're using the | ||
correct variants.""" | ||
assert ActionKind.CHATLLM == 'chat-llm' | ||
assert ActionKind.CUSTOM == 'custom' | ||
assert ActionKind.EMBEDDER == 'embedder' | ||
assert ActionKind.EVALUATOR == 'evaluator' | ||
assert ActionKind.FLOW == 'flow' | ||
assert ActionKind.INDEXER == 'indexer' | ||
assert ActionKind.MODEL == 'model' | ||
assert ActionKind.PROMPT == 'prompt' | ||
assert ActionKind.RETRIEVER == 'retriever' | ||
assert ActionKind.TEXTLLM == 'text-llm' | ||
assert ActionKind.TOOL == 'tool' | ||
assert ActionKind.UTIL == 'util' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Copyright 2025 Google LLC | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
# -*- coding: utf-8 -*- | ||
|
||
"""Contains definitions for custom headers used by the framework and other | ||
related functionality.""" | ||
|
||
from enum import Enum | ||
|
||
|
||
class HttpHeader(str, Enum): | ||
X_GENKIT_VERSION = 'X-Genkit-Version' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
# Copyright 2025 Google LLC | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
from __future__ import annotations | ||
|
||
import abc | ||
|
Oops, something went wrong.