BasicPlanner doesn't work with 'from semantic_kernel.connectors.ai.open_ai import AzureChatCompletion' #5011
Closed
yuichiromukaiyama
started this conversation in
General
Replies: 3 comments 2 replies
-
same problem |
Beta Was this translation helpful? Give feedback.
0 replies
-
PR https://github.com/microsoft/semantic-kernel/pull/5071/files |
Beta Was this translation helpful? Give feedback.
1 reply
-
Hi @yuichiromukaiyama, please, in the future, open this as a GitHub issue instead of a Discussion. We'll be able to get to this much faster. Thank you! |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
This issue is related to #4923. I am posting this as a question as well, as I have been struggling with how to handle this issue. Here is a minimal code that reproduces the problem.
When I run it, I get the error
'Choice' object has no attribute 'logprobs'
as in Issue.Investigating the cause, I found that BasicPlanner is calling
create_semantic_function
internally.semantic-kernel/python/semantic_kernel/planning/basic_planner.py
Line 186 in 1490eb6
Further tracing inside reveals the following line, which uses
PromptTemplate
.semantic-kernel/python/semantic_kernel/kernel.py
Line 870 in 1490eb6
This causes harm in the following places
has_chat_prompt
is alwaysFalse
forPromptTemplate
.semantic-kernel/python/semantic_kernel/kernel.py
Line 727 in 1490eb6
Therefore,
AzureChatCompletion
is not used when creating a plan in BasicPlanner. As proof, I changePromptTemplate
toChatPromptTemplate
and run it and it works fine.Is there a workable solution to this? I am thinking as follows
Python: AttributeError: 'Choice' object has no attribute 'logprobs' #4923 made 'logprobs' nullable for ChatCompletion only. Publish a PR that modifies TextCompletion as well.
Publish a PR to change 'PromptTemplate' to 'ChatPromptTemplate' according to chat-service.
BasicPlanner uses the principle TextCompletion or AzureTextCompletion
※ In case 3, I think it's better to change the Quick Start.
https://github.com/microsoft/semantic-kernel/blob/main/python/notebooks/05-using-the-planner.ipynb
Beta Was this translation helpful? Give feedback.
All reactions