-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
I appreciate your work for the SDK. I'm currently testing the SDK and was wondering how one can configure the completions endpoint to emit JSON Schema. This is what I've currently tried:
from openrouter import OpenRouter
from openrouter.components import JSONSchemaConfig, ResponseFormatJSONSchema
with OpenRouter(api_key=self.config.api_key) as client:
response = await client.completions.generate_async(
model=self.config.model,
prompt=prompt,
seed=self.config.seed,
temperature=self.config.temperature,
top_p=self.config.top_p,
response_format=ResponseFormatJSONSchema(
json_schema=JSONSchemaConfig(
name="Hello world",
description="Foo",
schema_=schema.model_json_schema(),
)
),
)ArjunJagdale
Metadata
Metadata
Assignees
Labels
No labels