File tree Expand file tree Collapse file tree 4 files changed +51
-13
lines changed Expand file tree Collapse file tree 4 files changed +51
-13
lines changed Original file line number Diff line number Diff line change 11[tool .poetry ]
22name = " zhipuai"
3- version = " 2.1.5.20250716 "
3+ version = " 2.1.5.20250724 "
44description = " A SDK library for accessing big model apis from ZhipuAI"
55authors = [" Zhipu AI" ]
66readme = " README.md"
@@ -45,15 +45,13 @@ cli = ["typer"]
4545# An extra used to be able to add extended testing.
4646# Please use new-line on formatting to make it easier to add new packages without
4747# merge-conflicts
48- extended_testing = [
49- " langchain" ,
50- ]
48+ extended_testing = [" langchain" ]
5149
5250[tool .ruff .lint ]
5351select = [
54- " E" , # pycodestyle
55- " F" , # pyflakes
56- " I" , # isort
52+ " E" , # pycodestyle
53+ " F" , # pyflakes
54+ " I" , # isort
5755 " T201" , # print
5856]
5957
@@ -66,9 +64,7 @@ indent-style = "tab"
6664docstring-code-format = true
6765
6866[tool .coverage .run ]
69- omit = [
70- " tests/*" ,
71- ]
67+ omit = [" tests/*" ]
7268
7369[build-system ]
7470requires = [" poetry-core>=1.0.0" , " poetry-plugin-pypi-mirror==0.4.2" ]
Original file line number Diff line number Diff line change @@ -52,3 +52,46 @@ def test_completions_stream(logging_conf):
5252 print (err )
5353 except zhipuai .core ._errors .APIStatusError as err :
5454 print (err )
55+
56+ def test_correction ():
57+ client = ZhipuAI () # 请替换为实际API密钥
58+
59+ response = client .agents .invoke (
60+ agent_id = "intelligent_education_correction_agent" ,
61+ messages = [
62+ {
63+ "role" : "user" ,
64+ "content" : [
65+ {
66+ "type" : "image_url" ,
67+ "image_url" : "https://b0.bdstatic.com/e24937f1f6b9c0ff6895e1012c981515.jpg"
68+ }
69+ ]
70+ }
71+ ]
72+ )
73+ print (response )
74+
75+ def test_correction_result (image_id ,uuids ,trace_id ):
76+ client = ZhipuAI ()
77+
78+ response = client .agents .async_result (
79+ agent_id = "intelligent_education_correction_polling" ,
80+ custom_variables = {
81+ "images" : [
82+ {
83+ "image_id" : image_id ,
84+ "uuids" : uuids
85+ }
86+ ],
87+ "trace_id" : trace_id
88+ }
89+ )
90+ print (response )
91+
92+ def main ():
93+ test_correction ()
94+ # test_correction_result(image_id,uuids,trace_id)
95+
96+ if __name__ == "__main__" :
97+ main ()
Original file line number Diff line number Diff line change 1-
2- __version__ = 'v2.1.0'
1+ __version__ = 'v2.1.5.20250724'
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ class AgentsCompletionChoice(BaseModel):
1919 finish_reason : str
2020 message : AgentsCompletionMessage
2121
22- class AgentsError :
22+ class AgentsError ( BaseModel ) :
2323 code : Optional [str ] = None
2424 message : Optional [str ] = None
2525
You can’t perform that action at this time.
0 commit comments