MCPcopy
hub / github.com/openai/gpt-oss / process

Method process

gpt_oss/tools/tool.py:52–67  ·  view source on GitHub ↗

Process the message and return a list of messages to add to the conversation. The input message should already be applicable to this tool. Don't return the input message, just the new messages. If implementing a tool that has to block while calling a function use `c

(self, message: Message)

Source from the content-addressed store, hash-verified

50 return True
51
52 async def process(self, message: Message) -> AsyncIterator[Message]:
53 """
54 Process the message and return a list of messages to add to the conversation.
55 The input message should already be applicable to this tool.
56 Don't return the input message, just the new messages.
57
58 If implementing a tool that has to block while calling a function use `call_on_background_thread` to get a coroutine.
59
60 If you just want to test this use `evaluate_generator` to get the results.
61
62 Do not override this method; override `_process` below (to avoid interfering with tracing).
63 """
64 async for m in self._process(message):
65 if self.output_channel_should_match_input_channel:
66 _maybe_update_inplace_and_validate_channel(input_message=message, tool_message=m)
67 yield m
68
69 @abstractmethod
70 async def _process(self, message: Message) -> AsyncIterator[Message]:

Callers 6

pythonFunction · 0.80
run_toolFunction · 0.80
mainFunction · 0.80
runMethod · 0.80
run_toolMethod · 0.80
run_python_toolMethod · 0.80

Calls 2

_processMethod · 0.95

Tested by

no test coverage detected