Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Reliable long-document creation" #333

Merged
merged 1 commit into from
Feb 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading