mirror of
https://github.com/aljazceru/opencode.git
synced 2025-12-19 16:54:22 +01:00
ignore: python sdk (#2779)
Co-authored-by: Aiden Cline <aidenpcline@gmail.com>
This commit is contained in:
19
packages/sdk/python/examples/basic_usage.py
Normal file
19
packages/sdk/python/examples/basic_usage.py
Normal file
@@ -0,0 +1,19 @@
|
||||
# Basic usage example (placeholder)
|
||||
# After generating the client, this should reflect actual client entrypoints.
|
||||
|
||||
try:
|
||||
from opencode_ai import client # type: ignore
|
||||
except Exception: # pragma: no cover
|
||||
client = None
|
||||
|
||||
|
||||
def main() -> None:
|
||||
if client is None:
|
||||
print("Client not generated yet. Run the generator first:")
|
||||
print(" uv run python packages/sdk/python/scripts/generate.py")
|
||||
return
|
||||
print("Replace this with real example code once the client is generated.")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
6
packages/sdk/python/examples/file_status.py
Normal file
6
packages/sdk/python/examples/file_status.py
Normal file
@@ -0,0 +1,6 @@
|
||||
from opencode_ai import OpenCodeClient
|
||||
|
||||
client = OpenCodeClient()
|
||||
files = client.file_status() or []
|
||||
for f in files:
|
||||
print(f.path, f.type)
|
||||
4
packages/sdk/python/examples/session_list.py
Normal file
4
packages/sdk/python/examples/session_list.py
Normal file
@@ -0,0 +1,4 @@
|
||||
from opencode_ai import OpenCodeClient
|
||||
|
||||
client = OpenCodeClient()
|
||||
print([s.id for s in client.list_sessions() or []])
|
||||
Reference in New Issue
Block a user