Skip to content

Commit 9d5660b

Browse files
balogh.adam@icloud.combalogh.adam@icloud.com
authored andcommitted
fix docs
1 parent 8f3d2ef commit 9d5660b

10 files changed

Lines changed: 46 additions & 31 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ opengradient config init
5151
import os
5252
import opengradient as og
5353

54-
client = og.init(
54+
client = og.Client(
5555
private_key=os.environ.get("OG_PRIVATE_KEY"),
5656
email=None, # Optional: only needed for model uploads
5757
password=None,

docs/opengradient/client/alpha.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ including workflow management and ML model execution.
1616

1717
### Alpha
1818

19-
<code>class <b>Alpha</b>(blockchain: [Web3](docs/main.md#Web3), wallet_account: [local](docs/signers.md#local))</code>
19+
<code>class <b>Alpha</b>(blockchain: `Web3`, wallet_account: `LocalAccount`)</code>
2020

2121

2222

docs/opengradient/client/index.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ outline: [2,3]
88

99
## Submodules
1010

11-
* [alpha](docs/client.md#alpha): Alpha Testnet features for OpenGradient SDK.
12-
* [client](docs/client.md#client):
13-
* [exceptions](docs/client.md#exceptions):
14-
* [llm](docs/client.md#llm):
15-
* [model_hub](docs/client.md#model_hub):
16-
* [onchain_inference](docs/client.md#onchain_inference):
17-
* [x402_auth](docs/client.md#x402_auth): X402 Authentication handler for httpx streaming requests.
11+
* [alpha](./alpha): Alpha Testnet features for OpenGradient SDK.
12+
* [client](./client):
13+
* [exceptions](./exceptions):
14+
* [llm](./llm):
15+
* [model_hub](./model_hub):
16+
* [onchain_inference](./onchain_inference):
17+
* [x402_auth](./x402_auth): X402 Authentication handler for httpx streaming requests.
1818

1919
## Classes
2020

docs/opengradient/client/llm.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ outline: [2,3]
1111

1212
### LLM
1313

14-
<code>class <b>LLM</b>(wallet_account: [local](docs/signers.md#local), og_llm_server_url: str, og_llm_streaming_server_url: str)</code>
14+
<code>class <b>LLM</b>(wallet_account: `LocalAccount`, og_llm_server_url: str, og_llm_streaming_server_url: str)</code>
1515

1616

1717

docs/opengradient/client/onchain_inference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ outline: [2,3]
1111

1212
### Inference
1313

14-
<code>class <b>Inference</b>(blockchain: [Web3](docs/main.md#Web3), wallet_account: [local](docs/signers.md#local), inference_hub_contract_address: str, api_url: str)</code>
14+
<code>class <b>Inference</b>(blockchain: `Web3`, wallet_account: `LocalAccount`, inference_hub_contract_address: str, api_url: str)</code>
1515

1616

1717

docs/opengradient/client/x402_auth.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ authentication for streaming responses.
1616

1717
### X402Auth
1818

19-
<code>class <b>X402Auth</b>(account: Any, max_value: Optional[int] = None, payment_requirements_selector: Optional[Callable[[list[[PaymentRequirements](docs/types.md#PaymentRequirements)], Optional[str], Optional[str], Optional[int]][PaymentRequirements](docs/types.md#PaymentRequirements)]] = None, network_filter: Optional[str] = None)</code>
19+
<code>class <b>X402Auth</b>(account: Any, max_value: Optional[int] = None, payment_requirements_selector: Optional[Callable[[list[`PaymentRequirements`], Optional[str], Optional[str], Optional[int]]`PaymentRequirements`]] = None, network_filter: Optional[str] = None)</code>
2020

2121

2222

docs/opengradient/index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ OpenGradient Python SDK for interacting with AI models and infrastructure.
1010

1111
## Submodules
1212

13-
* [**agents**](./agents): OpenGradient LLM Adapters
14-
* [**alphasense**](./alphasense): OpenGradient AlphaSense Tools
15-
* [**client**](./client):
13+
* [**agents**](./agents/index): OpenGradient LLM Adapters
14+
* [**alphasense**](./alphasense/index): OpenGradient AlphaSense Tools
15+
* [**client**](./client/index):
1616
* [**types**](./types):
17-
* [**workflow_models**](./workflow_models): OpenGradient Hardcoded Models
17+
* [**workflow_models**](./workflow_models/index): OpenGradient Hardcoded Models
1818

1919
## Functions
2020

docs/opengradient/types.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ Enum for the different inference modes available for inference (VANILLA, ZKML, T
204204

205205
### InferenceResult
206206

207-
<code>class <b>InferenceResult</b>(transaction_hash: str, model_output: Dict[str, [**ndarray**](./ndarray)])</code>
207+
<code>class <b>InferenceResult</b>(transaction_hash: str, model_output: Dict[str, `ndarray`])</code>
208208

209209

210210

@@ -312,7 +312,7 @@ A collection of tensor inputs required for ONNX model inference.
312312

313313
### ModelOutput
314314

315-
<code>class <b>ModelOutput</b>(numbers: Dict[str, [**ndarray**](./ndarray)], strings: Dict[str, [**ndarray**](./ndarray)], jsons: Dict[str, [**ndarray**](./ndarray)], is_simulation_result: bool)</code>
315+
<code>class <b>ModelOutput</b>(numbers: Dict[str, `ndarray`], strings: Dict[str, `ndarray`], jsons: Dict[str, `ndarray`], is_simulation_result: bool)</code>
316316

317317

318318

docs/opengradient/workflow_models/index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ OpenGradient Hardcoded Models
1010

1111
## Submodules
1212

13-
* [constants](docs/workflow_models.md#constants): Constants used by the models module
14-
* [types](docs/workflow_models.md#types): Type definitions for models module.
15-
* [utils](docs/workflow_models.md#utils): Utility functions for the models module.
16-
* [workflow_models](docs/workflow_models.md#workflow_models): Repository of OpenGradient quantitative workflow models.
13+
* [constants](./constants): Constants used by the models module
14+
* [types](./types): Type definitions for models module.
15+
* [utils](./utils): Utility functions for the models module.
16+
* [workflow_models](./workflow_models): Repository of OpenGradient quantitative workflow models.

templates/text.mako

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,34 @@ outline: [2,3]
2929
def firstline(ds):
3030
return ds.split('\n\n', 1)[0]
3131
32-
def link(dobj: pdoc.Doc, name=None):
33-
name = name or dobj.qualname + ('()' if isinstance(dobj, pdoc.Function) else '')
34-
35-
# dobj.module is None so pull module name from qualname
32+
def link(dobj, name=None):
3633
parts = dobj.qualname.split('.')
34+
35+
if name is None:
36+
display = parts[-1]
37+
if isinstance(dobj, pdoc.Function):
38+
display += '()'
39+
else:
40+
display = name
41+
42+
# External types (not from opengradient) - render as plain code
43+
if len(parts) >= 2 and parts[0] != 'opengradient':
44+
return '`{}`'.format(display)
45+
3746
if len(parts) < 2:
38-
return '`{}`'.format(parts[0])
39-
app = parts[0]
47+
return '`{}`'.format(display)
48+
4049
module = parts[1]
50+
51+
# 3+ parts: submodule or nested object within a submodule
4152
if len(parts) > 2:
42-
obj = parts[2]
43-
return '[{}](docs/{}.md#{})'.format(obj, module, obj)
44-
return '[**{}**](./{})'.format(module, module)
53+
target = parts[2]
54+
return '[{}](./{})'.format(display, target)
55+
56+
# 2 parts: top-level module/package reference
57+
if isinstance(dobj, pdoc.Module) and dobj.is_package:
58+
return '[**{}**](./{}/index)'.format(display, module)
59+
return '[**{}**](./{})'.format(display, module)
4560
4661
def get_annotation(bound_method, sep=':'):
4762
annot = show_type_annotations and bound_method() or ''

0 commit comments

Comments
 (0)