pycityagent 1.1.4__py3-none-any.whl → 1.1.5__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -32,13 +32,18 @@ class UrbanLLM:
32
32
  def __init__(self, config: LLMConfig) -> None:
33
33
  self.config = config
34
34
 
35
- def text_request(self, dialog:list[dict]) -> str:
35
+ def text_request(self, dialog:list[dict], temperature:float=1, max_tokens:int=None, top_p:float=None, frequency_penalty:float=None, presence_penalty:float=None) -> str:
36
36
  """
37
37
  文本相关请求
38
38
  Text request
39
39
 
40
40
  Args:
41
41
  - dialog (list[dict]): 标准的LLM文本dialog. The standard text LLM dialog
42
+ - temperature (float): default 1, used in openai
43
+ - max_tokens (int): default None, used in openai
44
+ - top_p (float): default None, used in openai
45
+ - frequency_penalty (float): default None, used in openai
46
+ - presence_penalty (float): default None, used in openai
42
47
 
43
48
  Returns:
44
49
  - (str): the response content
@@ -55,7 +60,11 @@ class UrbanLLM:
55
60
  response = client.chat.completions.create(
56
61
  model=self.config.text['model'],
57
62
  messages=dialog,
58
- temperature=1.0,
63
+ temperature=temperature,
64
+ max_tokens=max_tokens,
65
+ top_p=top_p,
66
+ frequency_penalty=frequency_penalty,
67
+ presence_penalty=presence_penalty
59
68
  )
60
69
  return response.choices[0].message.content
61
70
  elif self.config.text['request_type'] == 'qwen':
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pycityagent
3
- Version: 1.1.4
3
+ Version: 1.1.5
4
4
  Summary: LLM-based城市模拟器agent构建库
5
5
  Author-email: Yuwei Yan <pinkgranite86@gmail.com>
6
6
  License: MIT License
@@ -50,9 +50,9 @@ pycityagent/image/image.py,sha256=KyOBoX8I1KSi82lBCBku-NXgXX4gIFHi2cGEe7yQ-lI,53
50
50
  pycityagent/st/__init__.py,sha256=YzsQXrgqRvmoQ4dWqAztAriKd8wvnQVe0FOpX_oZmiY,109
51
51
  pycityagent/st/st.py,sha256=z6yDo7ADOjostLg0mLmQ0oa_VysaCXFm4MnzC2H9nsI,5154
52
52
  pycityagent/urbanllm/__init__.py,sha256=D24mYFXdIEL2vbvB7Cp_BGgJvg-tvEnCgtEAAGaqGDY,56
53
- pycityagent/urbanllm/urbanllm.py,sha256=7Dc71zGHvvPj1pV76ZzIMPheTVzmsoaL-fw0uc3RJb0,4579
54
- pycityagent-1.1.4.dist-info/LICENSE,sha256=Yo9QmwLDFU3VoOc0W8aYSCa5Yj5sJyqM3FEcbC2jMQQ,1063
55
- pycityagent-1.1.4.dist-info/METADATA,sha256=18S7XJjHvyBnTUtlK0KmAEZld1dgidg1jpAbe339Atg,7768
56
- pycityagent-1.1.4.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
57
- pycityagent-1.1.4.dist-info/top_level.txt,sha256=mf70CsOn3eVJBwHQ_TjCesoc-elD0Bj2WLsi5APRjlU,12
58
- pycityagent-1.1.4.dist-info/RECORD,,
53
+ pycityagent/urbanllm/urbanllm.py,sha256=z6mJyvFbu4cotxLuen0ODZUIpba9SOUwNg3HEbrGylI,5176
54
+ pycityagent-1.1.5.dist-info/LICENSE,sha256=Yo9QmwLDFU3VoOc0W8aYSCa5Yj5sJyqM3FEcbC2jMQQ,1063
55
+ pycityagent-1.1.5.dist-info/METADATA,sha256=zBD0UWeliRWImn4hPEDfTNNlyymcJOfsWQ7bscUJlgs,7768
56
+ pycityagent-1.1.5.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
57
+ pycityagent-1.1.5.dist-info/top_level.txt,sha256=mf70CsOn3eVJBwHQ_TjCesoc-elD0Bj2WLsi5APRjlU,12
58
+ pycityagent-1.1.5.dist-info/RECORD,,