Skip to content

Commit e0d8647

Browse files
committed
feat(py/genkit): solve pr comments
1 parent 9339880 commit e0d8647

File tree

2 files changed

+2
-36
lines changed

2 files changed

+2
-36
lines changed

py/plugins/compat-oai/src/genkit/plugins/compat_oai/openai_plugin.py

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -105,42 +105,7 @@ def _define_openai_model(self, ai: GenkitRegistry, name: str) -> None:
105105
metadata={
106106
'model': {
107107
'label': f"OpenAI - {name}",
108-
},
109-
},
110-
)
111-
112-
def resolve_action( # noqa: B027
113-
self,
114-
ai: GenkitRegistry,
115-
kind: ActionKind,
116-
name: str,
117-
) -> None:
118-
119-
if kind is not ActionKind.MODEL:
120-
return None
121-
122-
self._define_openai_model(ai, name)
123-
return None
124-
125-
def _define_openai_model(self, ai: GenkitRegistry, name: str) -> None:
126-
"""Defines and registers an OpenAI model with Genkit.
127-
128-
Cleans the model name, instantiates an OpenAI, and registers it
129-
with the provided Genkit AI registry, including metadata about its capabilities.
130-
131-
Args:
132-
ai: The Genkit AI registry instance.
133-
name: The name of the model to be registered.
134-
"""
135-
136-
handler = OpenAIModelHandler(OpenAIModel(name, self._openai_client, ai)).generate
137-
ai.define_model(
138-
name=f'openai/{name}',
139-
fn=handler,
140-
config_schema=OpenAIConfig,
141-
metadata={
142-
'model': {
143-
'label': f"OpenAI - {name}",
108+
'supports': {'multiturn': True}
144109
},
145110
},
146111
)

py/plugins/compat-oai/tests/test_plugin.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ def test_openai_plugin_resolve_action(kind, name):
6262
metadata={
6363
'model': {
6464
'label': model_info.label,
65+
'supports': {'multiturn': True}
6566
},
6667
},
6768
)

0 commit comments

Comments
 (0)