MCPcopy Index your code
hub / github.com/geekcomputers/Python / classify_action

Function classify_action

JARVIS/ai.py:56–64  ·  view source on GitHub ↗
(text)

Source from the content-addressed store, hash-verified

54
55
56def classify_action(text):
57 prompt = f"{ACTION_CLASSIFIER_PROMPT}\nUser: {text}"
58 try:
59 response = lm_client().responses.create(model=OPENAI_MODEL, input=prompt, max_output_tokens=40)
60 except OpenAIError as exc:
61 state.debug("action error", str(exc))
62 return "chat"
63 debug_response("action", prompt, response)
64 return response.output_text.strip().splitlines()[0].strip()

Callers 1

handle_user_textFunction · 0.85

Calls 3

lm_clientFunction · 0.85
debug_responseFunction · 0.85
debugMethod · 0.80

Tested by

no test coverage detected