MCPcopy Create free account
hub / github.com/OpenRouterTeam/python-sdk / next_func

Method next_func

src/openrouter/byok.py:122–149  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

120 )
121
122 def next_func() -> Optional[operations.ListBYOKKeysResponse]:
123 body = utils.unmarshal_json(http_res.text, Union[Dict[Any, Any], List[Any]])
124
125 offset = request.offset if isinstance(request.offset, int) else 0
126
127 if not http_res.text:
128 return None
129 results = JSONPath("$.data").parse(body)
130 if len(results) == 0 or len(results[0]) == 0:
131 return None
132 limit_ = request.limit if isinstance(request.limit, int) else 0
133 if len(results[0]) < limit_:
134 return None
135 next_offset = offset + len(results[0])
136
137 return self.list(
138 http_referer=http_referer,
139 x_open_router_title=x_open_router_title,
140 x_open_router_categories=x_open_router_categories,
141 offset=next_offset,
142 limit=limit,
143 workspace_id=workspace_id,
144 provider=provider,
145 retries=retries,
146 server_url=server_url,
147 timeout_ms=timeout_ms,
148 http_headers=http_headers,
149 )
150
151 response_data: Any = None
152 if utils.match_response(http_res, "200", "application/json"):

Callers

nothing calls this directly

Calls 2

listMethod · 0.95
list_asyncMethod · 0.95

Tested by

no test coverage detected