gitcode_api.llm.openai

OpenAI tool adapter for the GitCode SDK.

Classes

GitCodeOpenAITool([async_mode, indent])

OpenAI-compatible callable tool for invoking GitCode SDK resources.

class GitCodeOpenAITool(async_mode: bool = False, indent: int = 2, **kwargs)

Bases: GitCodeLLMTool

OpenAI-compatible callable tool for invoking GitCode SDK resources.

Parameters:
  • async_mode – When true, calling the instance returns the async tool coroutine.

  • indentindent argument passed to json.dumps() when serializing invocation results (default 2).

  • kwargs – Passed to gitcode_api.llm.GitCodeLLMToolclient, async_client, api_key, owner, repo, base_url, timeout, decrypt.

Create an OpenAI tool wrapper.

property tool: Dict[str, Any]

Return this tool in OpenAI Chat Completions tool format.

to_dict() Dict[str, Any]

Return this tool in OpenAI Chat Completions tool format.