/
githubmirror
/
AgentPilot
Обзор
Документация
Войти
/
githubmirror
/
AgentPilot
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
v0.0.9
agentpilot/plugins/plugin.py
33 строки
1 KB
jb
preparation for binaries
26 окт 2023, 01:44
26 окт 2023, 01:44
229f0e8
Код
Авторство
О чём код?
from agentpilot.utils.apis import llm class AgentPlugin: # todo - refactor def __init__(self): self.agent_object = None self.stream_object_base = None self.system_msg = '' def stream(self, messages, msgs_in_system=False, system_msg='', model='gpt-3.5-turbo', use_davinci=False): # TEMPORARY STREAM AS PLUGIN if not use_davinci: stream, initial_prompt = llm.get_chat_response(messages if not msgs_in_system else [], system_msg, model=model, temperature=0.7) # todo - add setting for temperature on each part for resp in stream: delta = resp.choices[0].get('delta', {}) if not delta: continue text = delta.get('content', '') yield 'assistant', text else: 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__()