Jarvis use gpt-3.5
This commit is contained in:
@@ -248,6 +248,14 @@ class AIAgent:
|
||||
async def _get_agent_prompt(self) -> AgentPrompt:
|
||||
return self.prompt
|
||||
|
||||
def _format_msg_by_env_value(self,prompt:AgentPrompt):
|
||||
if self.owner_env is None:
|
||||
return
|
||||
|
||||
for msg in prompt.messages:
|
||||
old_content = msg.get("content")
|
||||
msg["content"] = old_content.format_map(self.owner_env)
|
||||
|
||||
async def _process_msg(self,msg:AgentMsg) -> AgentMsg:
|
||||
from .compute_kernel import ComputeKernel
|
||||
from .bus import AIBus
|
||||
@@ -269,6 +277,7 @@ class AIAgent:
|
||||
msg_prompt.messages = [{"role":"user","content":msg.body}]
|
||||
prompt.append(msg_prompt)
|
||||
|
||||
self._format_msg_by_env_value(prompt)
|
||||
inner_functions = self._get_inner_functions()
|
||||
|
||||
task_result:ComputeTaskResult = await ComputeKernel.get_instance().do_llm_completion(prompt,self.llm_model_name,self.max_token_size,inner_functions)
|
||||
|
||||
@@ -167,8 +167,12 @@ class OpenAI_ComputeNode(ComputeNode):
|
||||
|
||||
def is_support(self, task: ComputeTask) -> bool:
|
||||
if task.task_type == ComputeTaskType.LLM_COMPLETION:
|
||||
if not task.params["model_name"] or task.params["model_name"] == "gpt-4-0613":
|
||||
if not task.params["model_name"]:
|
||||
return True
|
||||
model_name : str = task.params["model_name"]
|
||||
if model_name.startswith("gpt-"):
|
||||
return True
|
||||
|
||||
if task.task_type == ComputeTaskType.TEXT_EMBEDDING:
|
||||
if task.params["model_name"] == "text-embedding-ada-002":
|
||||
return True
|
||||
|
||||
Reference in New Issue
Block a user