/
githubmirror
/
AgentPilot
Обзор
Документация
Войти
/
githubmirror
/
AgentPilot
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
v0.0.2
openagent/plugins/plugin.py
33 строки
1 KB
jbexta
initial gui release, still some features not yet implemented
16 окт 2023, 20:19
16 окт 2023, 20:19
49da414
Код
Авторство
О чём код?
from 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='', use_gpt4=None, 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='gpt-3.5-turbo' if not use_gpt4 else 'gpt-4', 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__()