/
githubmirror
/
AgentPilot
Обзор
Документация
Войти
/
githubmirror
/
AgentPilot
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
v0.1.4
agentpilot/plugins/plugin.py
36 строк
1 KB
jbexta
last bits
28 ноя 2023, 04:12
28 ноя 2023, 04:12
544cdc4
Код
Авторство
О чём код?
from agentpilot.utils.apis import llm class AgentPlugin: # todo - refactor def __init__(self): # , member_id): self.agent_object = None self.stream_object_base = None # self.member_id = member_id self.system_msg = '' self.logging_obj = None def stream(self, messages, msgs_in_system=False, system_msg='', model=None): # , use_davinci=False): # TEMPORARY STREAM AS PLUGIN # if not use_davinci: stream = llm.get_chat_response(messages if not msgs_in_system else [], system_msg, model_obj=model) # todo - add setting for temperature on each part self.logging_obj = stream.logging_obj for resp in stream: delta = resp.choices[0].get('delta', {}) if not delta: continue text = delta.get('content', '') yield 'assistant', text # else: # raise NotImplementedError() # # stream = llm.get_completion(system_msg) # # for resp in stream: # # delta = resp.choices[0].get('delta', {}) # # if not delta: continue # # text = delta.get('content', '') # # yield 'assistant', text class TaskPlugin: def __init__(self): super().__init__()