coze-dev / coze-dev/coze-py

Input should be a valid dictionary or instance of Message [type=model_type, input_value='code', input_type=str]

Open
#298 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
492
Forks
122
PR merge metrics
No merged PRs in 30d

Description

如果加自定参数??按照文档上怎么试都不行

智能体:单agent对话流
我的代码:
`parameters = {
"exists_consultant": {
"value": "存在"
}
}
chat_poll = coze.chat.create_and_poll(
bot_id=bot_id,
user_id=user_id,
parameters=parameters,
additional_messages=[
Message.build_user_question_text("求清单?")
],
)
for message in chat_poll.messages:
print(message.content, end="", flush=True)

if chat_poll.chat.status == ChatStatus.COMPLETED:
print()
print("token usage:", chat_poll.chat.usage.token_count)`

报错:`parameters = {
"exists_consultant": {
"value": "存在"
}
}
chat_poll = coze.chat.create_and_poll(
bot_id=bot_id,
user_id=user_id,
parameters=parameters,
additional_messages=[
Message.build_user_question_text("求清单?")
],
)
for message in chat_poll.messages:
print(message.content, end="", flush=True)

if chat_poll.chat.status == ChatStatus.COMPLETED:
print()
print("token usage:", chat_poll.chat.usage.token_count)`

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the supplied coze.chat.create_and_poll call with the custom parameters and Message.build_user_question_text input. Trace the validation that raises the model_type error and compare the accepted parameter shape with the documentation; done means the example runs without the validation error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.