mirror of
https://github.com/anomalyco/opencode-sdk-python.git
synced 2026-04-29 05:00:01 +00:00
feat(api): api update
This commit is contained in:
parent
94575f6882
commit
f1d9d8f9ec
5 changed files with 29 additions and 25 deletions
|
|
@ -5,7 +5,7 @@ from typing_extensions import Literal, Annotated, TypeAlias
|
|||
|
||||
from pydantic import Field as FieldInfo
|
||||
|
||||
from .config import ModeUnnamedTypeWithobjectParent0ModeUnnamedTypeWithobjectParent0Item
|
||||
from . import mode
|
||||
from .._utils import PropertyInfo
|
||||
from .._models import BaseModel
|
||||
from .keybinds import Keybinds
|
||||
|
|
@ -21,8 +21,6 @@ __all__ = [
|
|||
"ExperimentalHookSessionCompleted",
|
||||
"Mcp",
|
||||
"Mode",
|
||||
"ModeBuild",
|
||||
"ModePlan",
|
||||
"Provider",
|
||||
"ProviderModels",
|
||||
"ProviderModelsCost",
|
||||
|
|
@ -55,32 +53,16 @@ class Experimental(BaseModel):
|
|||
Mcp: TypeAlias = Annotated[Union[McpLocal, McpRemote], PropertyInfo(discriminator="type")]
|
||||
|
||||
|
||||
class ModeBuild(BaseModel):
|
||||
model: Optional[str] = None
|
||||
|
||||
prompt: Optional[str] = None
|
||||
|
||||
tools: Optional[Dict[str, bool]] = None
|
||||
|
||||
|
||||
class ModePlan(BaseModel):
|
||||
model: Optional[str] = None
|
||||
|
||||
prompt: Optional[str] = None
|
||||
|
||||
tools: Optional[Dict[str, bool]] = None
|
||||
|
||||
|
||||
class Mode(BaseModel):
|
||||
build: Optional[ModeBuild] = None
|
||||
build: Optional[mode.Mode] = None
|
||||
|
||||
plan: Optional[ModePlan] = None
|
||||
plan: Optional[mode.Mode] = None
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# Stub to indicate that arbitrary properties are accepted.
|
||||
# To access properties that are not valid identifiers you can use `getattr`, e.g.
|
||||
# `getattr(obj, '$type')`
|
||||
def __getattr__(self, attr: str) -> ModeUnnamedTypeWithobjectParent0ModeUnnamedTypeWithobjectParent0Item: ...
|
||||
def __getattr__(self, attr: str) -> mode.Mode: ...
|
||||
|
||||
|
||||
class ProviderModelsCost(BaseModel):
|
||||
|
|
@ -161,6 +143,9 @@ class Config(BaseModel):
|
|||
keybinds: Optional[Keybinds] = None
|
||||
"""Custom keybind configurations"""
|
||||
|
||||
layout: Optional[Literal["auto", "stretch"]] = None
|
||||
"""Layout to use for the TUI"""
|
||||
|
||||
log_level: Optional[LogLevel] = None
|
||||
"""Minimum log level to write to log files"""
|
||||
|
||||
|
|
|
|||
|
|
@ -86,6 +86,9 @@ class Keybinds(BaseModel):
|
|||
session_compact: str
|
||||
"""Compact the session"""
|
||||
|
||||
session_export: str
|
||||
"""Export session to editor"""
|
||||
|
||||
session_interrupt: str
|
||||
"""Interrupt current session"""
|
||||
|
||||
|
|
|
|||
15
src/opencode_ai/types/mode1.py
Normal file
15
src/opencode_ai/types/mode1.py
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
|
||||
from typing import Dict, Optional
|
||||
|
||||
from .._models import BaseModel
|
||||
|
||||
__all__ = ["Mode"]
|
||||
|
||||
|
||||
class Mode(BaseModel):
|
||||
model: Optional[str] = None
|
||||
|
||||
prompt: Optional[str] = None
|
||||
|
||||
tools: Optional[Dict[str, bool]] = None
|
||||
Loading…
Add table
Add a link
Reference in a new issue