Execution Environment¶
- class oscopilot.environments.env.Env[source]¶
Bases:
BaseEnvA class representing an environment for executing code in various languages.
This class manages the execution of code in different languages and provides methods for interacting with those languages.
It inherits from BaseEnv, which provides basic environment functionality.
- get_language(language)[source]¶
Gets the language class based on the provided language name or alias.
- Parameters:
language (str) – The name or alias of the language.
- Returns:
The language class corresponding to the provided name or alias, or None if not found.
- Return type:
class
- step(language, code, stream=False, display=False)[source]¶
Executes a step of code in the specified language.
- Parameters:
language (str) – The name or alias of the language to execute the code in.
code (str) – The code to execute.
stream (bool) – Whether to stream the output as it becomes available.
display (bool) – Whether to display the output.
- Returns:
The state after executing the code.
- Return type: