Coverage for examples/CustomMarketPlugin/agentlib_plugin/custom_market.py: 100%
14 statements
« prev ^ index » next coverage.py v7.4.4, created at 2026-06-17 09:09 +0000
« prev ^ index » next coverage.py v7.4.4, created at 2026-06-17 09:09 +0000
1from agentlib_flexquant import flexibility_market
2from agentlib.core.datamodels import AgentVariable
3from pydantic import Field
5class CustomMarketConfig(flexibility_market.FlexibilityMarketModuleConfig):
6 custom_string: str = Field(
7 title="Custom String",
8 description="Just an example of a custom String.",
9 )
11class CustomMarketModule(flexibility_market.FlexibilityMarketModule):
12 config: CustomMarketConfig
14 def custom_flexibility_callback(self, inp: AgentVariable, name: str):
15 """Placeholder for a custom flexibility callback."""
16 offer = inp.value
17 offer.status = "Custom status"
18 self.write_results(offer=offer)
20 print("My custom string is: " + self.config.custom_string)
21 print("Recieved offer: " + str(offer))
22 pass