Skip to content
Snippets Groups Projects
Unverified Commit 63df003c authored by Siraj R Aizlewood's avatar Siraj R Aizlewood
Browse files

Linting and addressing more of James' comments.

parent 04ae1a9f
No related branches found
No related tags found
No related merge requests found
......@@ -101,8 +101,7 @@ class OpenAILLM(BaseLLM):
content = completion.choices[0].message.content
if content is None:
raise ValueError("Invalid output, expected content.")
output = str(content) # str in keepign with base type.
output = content
return output
except Exception as e:
......@@ -112,10 +111,11 @@ class OpenAILLM(BaseLLM):
def extract_function_inputs(
self, query: str, function_schemas: List[Dict[str, Any]]
) -> List[Dict[str, Any]]:
messages = []
system_prompt = "You are an intelligent AI. Given a command or request from the user, call the function to complete the request."
messages.append(Message(role="system", content=system_prompt))
messages.append(Message(role="user", content=query))
messages = [
Message(role="system", content=system_prompt),
Message(role="user", content=query),
]
output = self(messages=messages, function_schemas=function_schemas)
if not output:
raise Exception("No output generated for extract function input")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment