Structured Response using Semantic functions #10154
Unanswered
Vinaysoni2310
asked this question in
Q&A
Replies: 1 comment
-
Hello @Vinaysoni2310, can you please have a look at these samples? I am able to run them both against OpenAI and Azure OpenAI: https://github.com/microsoft/semantic-kernel/tree/main/python/samples/concepts/structured_output |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I am trying to build a chatbot using semantic kernel, but llm response doesn't always follow the json format response mentioned in the prompt of each function.
I tried using semantic_kernel.pydantic library but that gives me another Validation error like input should be dict type.
class botresponse(KernelBaseModel):
BotResponse:str
req_settings = kernel.get_prompt_execution_settings_from_service_id(service_id=service_id)
req_settings.max_tokens = 2000
req_settings.temperature = 0.7
req_settings.top_p = 0.8
req_settings.function_choice_behavior = FunctionChoiceBehavior.Auto(filters={"excluded_plugins": ["chat"]})
req_settings.response_format = botresponse
Please if somebody can help to resolve this. I am using gpt-4o to make calls.
Beta Was this translation helpful? Give feedback.
All reactions