Skip to content

Commit

Permalink
Revert "Reliable long-document creation" (#333)
Browse files Browse the repository at this point in the history
Reverts #331
  • Loading branch information
markwaddle authored Feb 20, 2025
1 parent 4c14b0d commit da32d62
Show file tree
Hide file tree
Showing 18 changed files with 1,250 additions and 2,917 deletions.
1 change: 0 additions & 1 deletion assistants/prospector-assistant/.vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
"python.analysis.inlayHints.functionReturnTypes": true,
"python.analysis.typeCheckingMode": "standard",
"python.defaultInterpreterPath": "${workspaceFolder}/.venv",
"python.testing.pytestEnabled": true,
"[python]": {
"editor.defaultFormatter": "charliermarsh.ruff",
"editor.formatOnSave": true,
Expand Down
56 changes: 25 additions & 31 deletions assistants/prospector-assistant/assistant/agents/artifact_agent.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from pathlib import Path
from typing import TYPE_CHECKING, Annotated, Literal, Union

from pydantic import BaseModel, ConfigDict, Field
from pydantic import BaseModel, Field
from semantic_workbench_assistant.assistant_app import (
AssistantConversationInspectorStateDataModel,
BaseModelAssistantConfig,
Expand Down Expand Up @@ -67,70 +67,65 @@ class ArtifactAgentConfigModel(BaseModel):


class ArtifactMarkdownContent(BaseModel):
model_config = ConfigDict(
extra="forbid",
json_schema_extra={
class Config:
extra = "forbid"
json_schema_extra = {
"description": (
"The content of the artifact in markdown format. Use this type for any general text that"
" does not match another, more specific type."
),
"required": ["content_type"],
},
)
}

content_type: Literal["markdown"] = "markdown"


class ArtifactCodeContent(BaseModel):
model_config = ConfigDict(
extra="forbid",
json_schema_extra={
class Config:
extra = "forbid"
json_schema_extra = {
"description": (
"The content of the artifact in code format with a specified language for syntax highlighting."
),
"required": ["content_type", "language"],
},
)
}

content_type: Literal["code"] = "code"
language: str


class ArtifactMermaidContent(BaseModel):
model_config = ConfigDict(
extra="forbid",
json_schema_extra={
class Config:
extra = "forbid"
json_schema_extra = {
"description": "The content of the artifact in mermaid format, which will be rendered as a diagram.",
"required": ["content_type"],
},
)
}

content_type: Literal["mermaid"] = "mermaid"


class ArtifactAbcContent(BaseModel):
model_config = ConfigDict(
extra="forbid",
json_schema_extra={
class Config:
extra = "forbid"
json_schema_extra = {
"description": (
"The content of the artifact in abc format, which will be rendered as sheet music, an interactive player,"
" and available for download."
),
"required": ["content_type"],
},
)
}

content_type: Literal["abc"] = "abc"


class ArtifactExcalidrawContent(BaseModel):
model_config = ConfigDict(
extra="forbid",
json_schema_extra={
class Config:
extra = "forbid"
json_schema_extra = {
"description": ("The content of the artifact in Excalidraw format, which will be rendered as a diagram."),
"required": ["content_type", "excalidraw"],
},
)
}

content_type: Literal["excalidraw"] = "excalidraw"

Expand All @@ -145,18 +140,17 @@ class ArtifactExcalidrawContent(BaseModel):


class Artifact(BaseModel):
model_config = ConfigDict(
extra="forbid",
json_schema_extra={
class Config:
extra = "forbid"
json_schema_extra = {
"description": (
"Data for the artifact, which includes a label, content, filename, type, and version. The filename"
" should be unique for each artifact, and the version should start at 1 and increment for each new"
" version of the artifact. The type should be one of the specific content types and include any"
" additional fields required for that type."
),
"required": ["label", "content", "filename", "type", "version"],
},
)
}

label: str
content: str
Expand Down
Loading

0 comments on commit da32d62

Please sign in to comment.