claude-code-workflow 7.2.29 → 7.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.ccw/workflows/cli-templates/schemas/plan-overview-base-schema.json +2 -2
- package/.ccw/workflows/cli-templates/schemas/task-schema.json +14 -7
- package/.claude/agents/action-planning-agent.md +7 -4
- package/.claude/agents/cli-explore-agent.md +77 -63
- package/.claude/agents/cli-lite-planning-agent.md +11 -10
- package/.claude/agents/issue-plan-agent.md +421 -426
- package/.claude/commands/workflow/spec/setup.md +1 -1
- package/.claude/commands/workflow-skill.md +130 -0
- package/.claude/skills/ccw-chain/SKILL.md +92 -0
- package/.claude/skills/ccw-chain/chains/ccw-cycle.json +31 -0
- package/.claude/skills/ccw-chain/chains/ccw-exploration.json +58 -0
- package/.claude/skills/ccw-chain/chains/ccw-issue.json +44 -0
- package/.claude/skills/ccw-chain/chains/ccw-lightweight.json +71 -0
- package/.claude/skills/ccw-chain/chains/ccw-main.json +65 -0
- package/.claude/skills/ccw-chain/chains/ccw-standard.json +51 -0
- package/.claude/skills/ccw-chain/chains/ccw-team.json +15 -0
- package/.claude/skills/ccw-chain/chains/ccw-with-file.json +47 -0
- package/.claude/skills/ccw-chain/specs/auto-mode.md +47 -0
- package/.claude/skills/chain-loader/SKILL.md +78 -0
- package/.claude/skills/chain-loader/phases/01-analyze-skill.md +53 -0
- package/.claude/skills/chain-loader/phases/02-design-graph.md +73 -0
- package/.claude/skills/chain-loader/phases/03-generate-validate.md +75 -0
- package/.claude/skills/chain-loader/specs/chain-schema.md +126 -0
- package/.claude/skills/chain-loader/specs/design-patterns.md +99 -0
- package/.claude/skills/chain-loader/templates/chain-json.md +63 -0
- package/.claude/skills/review-cycle/phases/review-module.md +764 -764
- package/.claude/skills/review-cycle/phases/review-session.md +775 -775
- package/.claude/skills/workflow-multi-cli-plan/SKILL.md +2 -2
- package/.claude/skills/workflow-plan/SKILL.md +1 -0
- package/.claude/skills/workflow-plan/phases/01-session-discovery.md +19 -2
- package/.claude/skills/workflow-plan/phases/02-context-gathering.md +2 -2
- package/.claude/skills/workflow-plan/phases/03-conflict-resolution.md +422 -422
- package/.claude/skills/workflow-plan/phases/04-task-generation.md +9 -1
- package/.claude/skills/workflow-plan/phases/05-plan-verify.md +395 -395
- package/.claude/skills/workflow-tdd-plan/phases/02-context-gathering.md +407 -407
- package/.claude/skills/workflow-tdd-plan/phases/04-conflict-resolution.md +426 -426
- package/.claude/skills/workflow-test-fix/phases/02-test-context-gather.md +493 -493
- package/.codex/skills/analyze-with-file/SKILL.md +383 -134
- package/.codex/skills/brainstorm/SKILL.md +3 -3
- package/.codex/skills/brainstorm-with-file/SKILL.md +208 -88
- package/.codex/skills/clean/SKILL.md +1 -1
- package/.codex/skills/csv-wave-pipeline/SKILL.md +2 -2
- package/.codex/skills/investigate/orchestrator.md +24 -0
- package/.codex/skills/issue-discover/SKILL.md +374 -361
- package/.codex/skills/issue-discover/phases/01-issue-new.md +1 -1
- package/.codex/skills/issue-discover/phases/02-discover.md +2 -2
- package/.codex/skills/issue-discover/phases/03-discover-by-prompt.md +1 -1
- package/.codex/skills/issue-discover/phases/04-quick-execute.md +2 -2
- package/.codex/skills/parallel-dev-cycle/SKILL.md +44 -37
- package/.codex/skills/project-documentation-workflow/SKILL.md +1 -1
- package/.codex/skills/review-cycle/SKILL.md +31 -12
- package/.codex/skills/roadmap-with-file/SKILL.md +141 -133
- package/.codex/skills/security-audit/orchestrator.md +29 -0
- package/.codex/skills/session-sync/SKILL.md +1 -1
- package/.codex/skills/ship/orchestrator.md +24 -0
- package/.codex/skills/spec-add/SKILL.md +5 -5
- package/.codex/skills/spec-generator/SKILL.md +33 -2
- package/.codex/skills/spec-generator/phases/01-5-requirement-clarification.md +3 -3
- package/.codex/skills/spec-generator/phases/01-discovery.md +1 -1
- package/.codex/skills/spec-generator/phases/02-product-brief.md +1 -1
- package/.codex/skills/spec-generator/phases/03-requirements.md +1 -1
- package/.codex/skills/spec-generator/phases/04-architecture.md +1 -1
- package/.codex/skills/spec-generator/phases/05-epics-stories.md +1 -1
- package/.codex/skills/spec-generator/phases/06-readiness-check.md +1 -1
- package/.codex/skills/spec-generator/phases/07-issue-export.md +1 -1
- package/.codex/skills/spec-setup/SKILL.md +669 -669
- package/.codex/skills/team-arch-opt/specs/team-config.json +1 -1
- package/.codex/skills/team-brainstorm/SKILL.md +259 -259
- package/.codex/skills/team-coordinate/SKILL.md +359 -359
- package/.codex/skills/team-coordinate/roles/coordinator/commands/monitor.md +1 -1
- package/.codex/skills/team-designer/SKILL.md +27 -1
- package/.codex/skills/team-designer/phases/01-requirements-analysis.md +2 -2
- package/.codex/skills/team-designer/phases/02-scaffold-generation.md +1 -1
- package/.codex/skills/team-designer/phases/04-validation.md +1 -1
- package/.codex/skills/team-executor/SKILL.md +218 -218
- package/.codex/skills/team-frontend/SKILL.md +227 -227
- package/.codex/skills/team-frontend-debug/SKILL.md +278 -278
- package/.codex/skills/team-frontend-debug/roles/coordinator/commands/analyze.md +2 -2
- package/.codex/skills/team-interactive-craft/SKILL.md +220 -220
- package/.codex/skills/team-interactive-craft/roles/coordinator/role.md +209 -209
- package/.codex/skills/team-issue/SKILL.md +269 -269
- package/.codex/skills/team-issue/roles/coordinator/role.md +1 -1
- package/.codex/skills/team-lifecycle-v4/SKILL.md +305 -305
- package/.codex/skills/team-motion-design/SKILL.md +222 -222
- package/.codex/skills/team-motion-design/roles/coordinator/role.md +210 -210
- package/.codex/skills/team-perf-opt/SKILL.md +258 -258
- package/.codex/skills/team-perf-opt/specs/team-config.json +1 -1
- package/.codex/skills/team-planex/SKILL.md +216 -216
- package/.codex/skills/team-quality-assurance/SKILL.md +229 -229
- package/.codex/skills/team-review/SKILL.md +227 -227
- package/.codex/skills/team-roadmap-dev/SKILL.md +238 -238
- package/.codex/skills/team-roadmap-dev/roles/coordinator/commands/roadmap-discuss.md +5 -5
- package/.codex/skills/team-tech-debt/SKILL.md +206 -206
- package/.codex/skills/team-tech-debt/roles/coordinator/commands/monitor.md +1 -1
- package/.codex/skills/team-testing/SKILL.md +237 -237
- package/.codex/skills/team-ui-polish/SKILL.md +218 -218
- package/.codex/skills/team-ui-polish/roles/coordinator/role.md +213 -213
- package/.codex/skills/team-uidesign/SKILL.md +219 -219
- package/.codex/skills/team-uidesign/roles/coordinator/role.md +2 -2
- package/.codex/skills/team-ultra-analyze/SKILL.md +260 -260
- package/.codex/skills/team-ultra-analyze/roles/coordinator/commands/monitor.md +1 -1
- package/.codex/skills/team-ultra-analyze/roles/coordinator/role.md +1 -1
- package/.codex/skills/team-ux-improve/SKILL.md +227 -227
- package/.codex/skills/team-ux-improve/roles/coordinator/role.md +1 -1
- package/.codex/skills/team-ux-improve/specs/team-config.json +1 -1
- package/.codex/skills/team-visual-a11y/SKILL.md +319 -319
- package/.codex/skills/team-visual-a11y/roles/coordinator/role.md +213 -213
- package/.codex/skills/workflow-execute/SKILL.md +5 -5
- package/.codex/skills/workflow-lite-planex/SKILL.md +3 -3
- package/.codex/skills/workflow-plan/SKILL.md +3 -3
- package/.codex/skills/workflow-tdd-plan/SKILL.md +4 -4
- package/.codex/skills/workflow-test-fix-cycle/SKILL.md +403 -402
- package/README.md +14 -0
- package/ccw/dist/cli.d.ts.map +1 -1
- package/ccw/dist/cli.js +16 -0
- package/ccw/dist/cli.js.map +1 -1
- package/ccw/dist/commands/chain-loader.d.ts +2 -0
- package/ccw/dist/commands/chain-loader.d.ts.map +1 -0
- package/ccw/dist/commands/chain-loader.js +11 -0
- package/ccw/dist/commands/chain-loader.js.map +1 -0
- package/ccw/dist/commands/install.d.ts.map +1 -1
- package/ccw/dist/commands/install.js +52 -1
- package/ccw/dist/commands/install.js.map +1 -1
- package/ccw/dist/commands/launcher.d.ts +2 -0
- package/ccw/dist/commands/launcher.d.ts.map +1 -0
- package/ccw/dist/commands/launcher.js +434 -0
- package/ccw/dist/commands/launcher.js.map +1 -0
- package/ccw/dist/core/routes/litellm-api-routes.d.ts.map +1 -1
- package/ccw/dist/core/routes/litellm-api-routes.js +0 -23
- package/ccw/dist/core/routes/litellm-api-routes.js.map +1 -1
- package/ccw/dist/tools/chain-loader.d.ts +10 -0
- package/ccw/dist/tools/chain-loader.d.ts.map +1 -0
- package/ccw/dist/tools/chain-loader.js +1054 -0
- package/ccw/dist/tools/chain-loader.js.map +1 -0
- package/ccw/dist/tools/index.d.ts.map +1 -1
- package/ccw/dist/tools/index.js +2 -0
- package/ccw/dist/tools/index.js.map +1 -1
- package/ccw/dist/tools/json-builder.js +20 -0
- package/ccw/dist/tools/json-builder.js.map +1 -1
- package/ccw/dist/tools/skill-context-loader.d.ts.map +1 -1
- package/ccw/dist/tools/skill-context-loader.js +12 -26
- package/ccw/dist/tools/skill-context-loader.js.map +1 -1
- package/ccw/dist/types/chain-types.d.ts +112 -0
- package/ccw/dist/types/chain-types.d.ts.map +1 -0
- package/ccw/dist/types/chain-types.js +5 -0
- package/ccw/dist/types/chain-types.js.map +1 -0
- package/ccw/dist/utils/chain-visualizer.d.ts +13 -0
- package/ccw/dist/utils/chain-visualizer.d.ts.map +1 -0
- package/ccw/dist/utils/chain-visualizer.js +164 -0
- package/ccw/dist/utils/chain-visualizer.js.map +1 -0
- package/ccw/scripts/prepublish-clean.mjs +0 -1
- package/package.json +1 -3
- package/.claude/commands/cli/cli-init.md +0 -441
- package/.claude/commands/cli/codex-review.md +0 -361
- package/.claude/commands/flow-create.md +0 -663
- package/.claude/skills/team-edict.zip +0 -0
- package/ccw-litellm/README.md +0 -180
- package/ccw-litellm/pyproject.toml +0 -35
- package/ccw-litellm/src/ccw_litellm/__init__.py +0 -47
- package/ccw-litellm/src/ccw_litellm/cli.py +0 -108
- package/ccw-litellm/src/ccw_litellm/clients/__init__.py +0 -12
- package/ccw-litellm/src/ccw_litellm/clients/litellm_embedder.py +0 -270
- package/ccw-litellm/src/ccw_litellm/clients/litellm_llm.py +0 -198
- package/ccw-litellm/src/ccw_litellm/config/__init__.py +0 -22
- package/ccw-litellm/src/ccw_litellm/config/loader.py +0 -343
- package/ccw-litellm/src/ccw_litellm/config/models.py +0 -162
- package/ccw-litellm/src/ccw_litellm/interfaces/__init__.py +0 -14
- package/ccw-litellm/src/ccw_litellm/interfaces/embedder.py +0 -52
- package/ccw-litellm/src/ccw_litellm/interfaces/llm.py +0 -45
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
"""Pydantic configuration models for LiteLLM integration."""
|
|
2
|
-
|
|
3
|
-
from __future__ import annotations
|
|
4
|
-
|
|
5
|
-
from typing import Any
|
|
6
|
-
|
|
7
|
-
from pydantic import BaseModel, Field
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
class ProviderConfig(BaseModel):
|
|
11
|
-
"""Provider API configuration.
|
|
12
|
-
|
|
13
|
-
Supports environment variable substitution in the format ${ENV_VAR}.
|
|
14
|
-
"""
|
|
15
|
-
|
|
16
|
-
api_key: str | None = None
|
|
17
|
-
api_base: str | None = None
|
|
18
|
-
|
|
19
|
-
model_config = {"extra": "allow"}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
class LLMModelConfig(BaseModel):
|
|
23
|
-
"""LLM model configuration."""
|
|
24
|
-
|
|
25
|
-
provider: str
|
|
26
|
-
model: str
|
|
27
|
-
|
|
28
|
-
model_config = {"extra": "allow"}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
class EmbeddingModelConfig(BaseModel):
|
|
32
|
-
"""Embedding model configuration."""
|
|
33
|
-
|
|
34
|
-
provider: str # "openai", "fastembed", "ollama", etc.
|
|
35
|
-
model: str
|
|
36
|
-
dimensions: int
|
|
37
|
-
max_input_tokens: int = 8192 # Maximum tokens per embedding request
|
|
38
|
-
|
|
39
|
-
model_config = {"extra": "allow"}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
class RerankerModelConfig(BaseModel):
|
|
43
|
-
"""Reranker model configuration."""
|
|
44
|
-
|
|
45
|
-
provider: str # "siliconflow", "cohere", "jina", etc.
|
|
46
|
-
model: str
|
|
47
|
-
max_input_tokens: int = 8192 # Maximum tokens per reranking request
|
|
48
|
-
top_k: int = 50 # Default top_k for reranking
|
|
49
|
-
|
|
50
|
-
model_config = {"extra": "allow"}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
class LiteLLMConfig(BaseModel):
|
|
54
|
-
"""Root configuration for LiteLLM integration.
|
|
55
|
-
|
|
56
|
-
Example YAML:
|
|
57
|
-
version: 1
|
|
58
|
-
default_provider: openai
|
|
59
|
-
providers:
|
|
60
|
-
openai:
|
|
61
|
-
api_key: ${OPENAI_API_KEY}
|
|
62
|
-
api_base: https://api.openai.com/v1
|
|
63
|
-
anthropic:
|
|
64
|
-
api_key: ${ANTHROPIC_API_KEY}
|
|
65
|
-
llm_models:
|
|
66
|
-
default:
|
|
67
|
-
provider: openai
|
|
68
|
-
model: gpt-4
|
|
69
|
-
fast:
|
|
70
|
-
provider: openai
|
|
71
|
-
model: gpt-3.5-turbo
|
|
72
|
-
embedding_models:
|
|
73
|
-
default:
|
|
74
|
-
provider: openai
|
|
75
|
-
model: text-embedding-3-small
|
|
76
|
-
dimensions: 1536
|
|
77
|
-
"""
|
|
78
|
-
|
|
79
|
-
version: int = 1
|
|
80
|
-
default_provider: str = "openai"
|
|
81
|
-
providers: dict[str, ProviderConfig] = Field(default_factory=dict)
|
|
82
|
-
llm_models: dict[str, LLMModelConfig] = Field(default_factory=dict)
|
|
83
|
-
embedding_models: dict[str, EmbeddingModelConfig] = Field(default_factory=dict)
|
|
84
|
-
reranker_models: dict[str, RerankerModelConfig] = Field(default_factory=dict)
|
|
85
|
-
|
|
86
|
-
model_config = {"extra": "allow"}
|
|
87
|
-
|
|
88
|
-
def get_llm_model(self, model: str = "default") -> LLMModelConfig:
|
|
89
|
-
"""Get LLM model configuration by name.
|
|
90
|
-
|
|
91
|
-
Args:
|
|
92
|
-
model: Model name or "default"
|
|
93
|
-
|
|
94
|
-
Returns:
|
|
95
|
-
LLM model configuration
|
|
96
|
-
|
|
97
|
-
Raises:
|
|
98
|
-
ValueError: If model not found
|
|
99
|
-
"""
|
|
100
|
-
if model not in self.llm_models:
|
|
101
|
-
raise ValueError(
|
|
102
|
-
f"LLM model '{model}' not found in configuration. "
|
|
103
|
-
f"Available models: {list(self.llm_models.keys())}"
|
|
104
|
-
)
|
|
105
|
-
return self.llm_models[model]
|
|
106
|
-
|
|
107
|
-
def get_embedding_model(self, model: str = "default") -> EmbeddingModelConfig:
|
|
108
|
-
"""Get embedding model configuration by name.
|
|
109
|
-
|
|
110
|
-
Args:
|
|
111
|
-
model: Model name or "default"
|
|
112
|
-
|
|
113
|
-
Returns:
|
|
114
|
-
Embedding model configuration
|
|
115
|
-
|
|
116
|
-
Raises:
|
|
117
|
-
ValueError: If model not found
|
|
118
|
-
"""
|
|
119
|
-
if model not in self.embedding_models:
|
|
120
|
-
raise ValueError(
|
|
121
|
-
f"Embedding model '{model}' not found in configuration. "
|
|
122
|
-
f"Available models: {list(self.embedding_models.keys())}"
|
|
123
|
-
)
|
|
124
|
-
return self.embedding_models[model]
|
|
125
|
-
|
|
126
|
-
def get_reranker_model(self, model: str = "default") -> RerankerModelConfig:
|
|
127
|
-
"""Get reranker model configuration by name.
|
|
128
|
-
|
|
129
|
-
Args:
|
|
130
|
-
model: Model name or "default"
|
|
131
|
-
|
|
132
|
-
Returns:
|
|
133
|
-
Reranker model configuration
|
|
134
|
-
|
|
135
|
-
Raises:
|
|
136
|
-
ValueError: If model not found
|
|
137
|
-
"""
|
|
138
|
-
if model not in self.reranker_models:
|
|
139
|
-
raise ValueError(
|
|
140
|
-
f"Reranker model '{model}' not found in configuration. "
|
|
141
|
-
f"Available models: {list(self.reranker_models.keys())}"
|
|
142
|
-
)
|
|
143
|
-
return self.reranker_models[model]
|
|
144
|
-
|
|
145
|
-
def get_provider(self, provider: str) -> ProviderConfig:
|
|
146
|
-
"""Get provider configuration by name.
|
|
147
|
-
|
|
148
|
-
Args:
|
|
149
|
-
provider: Provider name
|
|
150
|
-
|
|
151
|
-
Returns:
|
|
152
|
-
Provider configuration
|
|
153
|
-
|
|
154
|
-
Raises:
|
|
155
|
-
ValueError: If provider not found
|
|
156
|
-
"""
|
|
157
|
-
if provider not in self.providers:
|
|
158
|
-
raise ValueError(
|
|
159
|
-
f"Provider '{provider}' not found in configuration. "
|
|
160
|
-
f"Available providers: {list(self.providers.keys())}"
|
|
161
|
-
)
|
|
162
|
-
return self.providers[provider]
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"""Abstract interfaces for ccw-litellm."""
|
|
2
|
-
|
|
3
|
-
from __future__ import annotations
|
|
4
|
-
|
|
5
|
-
from .embedder import AbstractEmbedder
|
|
6
|
-
from .llm import AbstractLLMClient, ChatMessage, LLMResponse
|
|
7
|
-
|
|
8
|
-
__all__ = [
|
|
9
|
-
"AbstractEmbedder",
|
|
10
|
-
"AbstractLLMClient",
|
|
11
|
-
"ChatMessage",
|
|
12
|
-
"LLMResponse",
|
|
13
|
-
]
|
|
14
|
-
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
import asyncio
|
|
4
|
-
from abc import ABC, abstractmethod
|
|
5
|
-
from typing import Any, Sequence
|
|
6
|
-
|
|
7
|
-
import numpy as np
|
|
8
|
-
from numpy.typing import NDArray
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
class AbstractEmbedder(ABC):
|
|
12
|
-
"""Embedding interface compatible with fastembed-style embedders.
|
|
13
|
-
|
|
14
|
-
Implementers only need to provide the synchronous `embed` method; an
|
|
15
|
-
asynchronous `aembed` wrapper is provided for convenience.
|
|
16
|
-
"""
|
|
17
|
-
|
|
18
|
-
@property
|
|
19
|
-
@abstractmethod
|
|
20
|
-
def dimensions(self) -> int:
|
|
21
|
-
"""Embedding vector size."""
|
|
22
|
-
|
|
23
|
-
@abstractmethod
|
|
24
|
-
def embed(
|
|
25
|
-
self,
|
|
26
|
-
texts: str | Sequence[str],
|
|
27
|
-
*,
|
|
28
|
-
batch_size: int | None = None,
|
|
29
|
-
**kwargs: Any,
|
|
30
|
-
) -> NDArray[np.floating]:
|
|
31
|
-
"""Embed one or more texts.
|
|
32
|
-
|
|
33
|
-
Returns:
|
|
34
|
-
A numpy array of shape (n_texts, dimensions).
|
|
35
|
-
"""
|
|
36
|
-
|
|
37
|
-
async def aembed(
|
|
38
|
-
self,
|
|
39
|
-
texts: str | Sequence[str],
|
|
40
|
-
*,
|
|
41
|
-
batch_size: int | None = None,
|
|
42
|
-
**kwargs: Any,
|
|
43
|
-
) -> NDArray[np.floating]:
|
|
44
|
-
"""Async wrapper around `embed` using a worker thread by default."""
|
|
45
|
-
|
|
46
|
-
return await asyncio.to_thread(
|
|
47
|
-
self.embed,
|
|
48
|
-
texts,
|
|
49
|
-
batch_size=batch_size,
|
|
50
|
-
**kwargs,
|
|
51
|
-
)
|
|
52
|
-
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
import asyncio
|
|
4
|
-
from abc import ABC, abstractmethod
|
|
5
|
-
from dataclasses import dataclass
|
|
6
|
-
from typing import Any, Literal, Sequence
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
@dataclass(frozen=True, slots=True)
|
|
10
|
-
class ChatMessage:
|
|
11
|
-
role: Literal["system", "user", "assistant", "tool"]
|
|
12
|
-
content: str
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
@dataclass(frozen=True, slots=True)
|
|
16
|
-
class LLMResponse:
|
|
17
|
-
content: str
|
|
18
|
-
raw: Any | None = None
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
class AbstractLLMClient(ABC):
|
|
22
|
-
"""LiteLLM-like client interface.
|
|
23
|
-
|
|
24
|
-
Implementers only need to provide synchronous methods; async wrappers are
|
|
25
|
-
provided via `asyncio.to_thread`.
|
|
26
|
-
"""
|
|
27
|
-
|
|
28
|
-
@abstractmethod
|
|
29
|
-
def chat(self, messages: Sequence[ChatMessage], **kwargs: Any) -> LLMResponse:
|
|
30
|
-
"""Chat completion for a sequence of messages."""
|
|
31
|
-
|
|
32
|
-
@abstractmethod
|
|
33
|
-
def complete(self, prompt: str, **kwargs: Any) -> LLMResponse:
|
|
34
|
-
"""Text completion for a prompt."""
|
|
35
|
-
|
|
36
|
-
async def achat(self, messages: Sequence[ChatMessage], **kwargs: Any) -> LLMResponse:
|
|
37
|
-
"""Async wrapper around `chat` using a worker thread by default."""
|
|
38
|
-
|
|
39
|
-
return await asyncio.to_thread(self.chat, messages, **kwargs)
|
|
40
|
-
|
|
41
|
-
async def acomplete(self, prompt: str, **kwargs: Any) -> LLMResponse:
|
|
42
|
-
"""Async wrapper around `complete` using a worker thread by default."""
|
|
43
|
-
|
|
44
|
-
return await asyncio.to_thread(self.complete, prompt, **kwargs)
|
|
45
|
-
|