mirror of
https://github.com/GuDaStudio/codexmcp.git
synced 2026-02-05 02:00:24 +08:00
v0.6.3:支持image参数
This commit is contained in:
@@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from ast import List
|
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
import queue
|
import queue
|
||||||
@@ -10,7 +9,7 @@ import subprocess
|
|||||||
import threading
|
import threading
|
||||||
import uuid
|
import uuid
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Annotated, Any, Dict, Generator, Literal, Optional
|
from typing import Annotated, Any, Dict, Generator, List, Literal, Optional
|
||||||
|
|
||||||
from mcp.server.fastmcp import FastMCP
|
from mcp.server.fastmcp import FastMCP
|
||||||
from pydantic import BeforeValidator, Field
|
from pydantic import BeforeValidator, Field
|
||||||
@@ -149,12 +148,12 @@ async def codex(
|
|||||||
bool,
|
bool,
|
||||||
"Return all messages (e.g. reasoning, tool calls, etc.) from the codex session. Set to `False` by default, only the agent's final reply message is returned.",
|
"Return all messages (e.g. reasoning, tool calls, etc.) from the codex session. Set to `False` by default, only the agent's final reply message is returned.",
|
||||||
] = False,
|
] = False,
|
||||||
# image: Annotated[
|
image: Annotated[
|
||||||
# Optional[List[Path]],
|
Optional[List[Path]],
|
||||||
# Field(
|
Field(
|
||||||
# description="Attach one or more image files to the initial prompt. Separate multiple paths with commas or repeat the flag.",
|
description="Attach one or more image files to the initial prompt. Separate multiple paths with commas or repeat the flag.",
|
||||||
# ),
|
),
|
||||||
# ] = None,
|
] = None,
|
||||||
model: Annotated[
|
model: Annotated[
|
||||||
Optional[str],
|
Optional[str],
|
||||||
Field(
|
Field(
|
||||||
@@ -176,8 +175,8 @@ async def codex(
|
|||||||
# Build command as list to avoid injection
|
# Build command as list to avoid injection
|
||||||
cmd = ["codex", "exec", "--sandbox", sandbox, "--cd", str(cd), "--json"]
|
cmd = ["codex", "exec", "--sandbox", sandbox, "--cd", str(cd), "--json"]
|
||||||
|
|
||||||
# if image is not None:
|
if image is not None:
|
||||||
# cmd.extend(["--image", ",".join(image)])
|
cmd.extend(["--image", ",".join(image)])
|
||||||
|
|
||||||
if model is not None:
|
if model is not None:
|
||||||
cmd.extend(["--model", model])
|
cmd.extend(["--model", model])
|
||||||
|
|||||||
Reference in New Issue
Block a user