Skip to content

Commit

Permalink
Merge pull request #196 from emcie-co/feature/mc-477-allow-adding-few…
Browse files Browse the repository at this point in the history
…-shot-examples-to-all-engine-components-from

Add few shot feature and implement it on guideline_proposer
  • Loading branch information
mc-dorzo authored Dec 25, 2024
2 parents fe84972 + e75c792 commit 22cef04
Show file tree
Hide file tree
Showing 9 changed files with 1,184 additions and 554 deletions.
12 changes: 11 additions & 1 deletion src/parlant/bin/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@
import uvicorn

from parlant.adapters.vector_db.chroma import ChromaDatabase
from parlant.core.engines.alpha import guideline_proposer
from parlant.core.engines.alpha import tool_caller
from parlant.core.engines.alpha import message_event_generator
from parlant.core.nlp.service import NLPService
from parlant.core.shots import ShotCollection
from parlant.core.tags import TagDocumentStore, TagStore
from parlant.api.app import create_api_app, ASGIApplication
from parlant.core.background_tasks import BackgroundTaskService
Expand Down Expand Up @@ -75,13 +79,15 @@
GuidelineToolAssociationDocumentStore,
GuidelineToolAssociationStore,
)
from parlant.core.engines.alpha.tool_caller import ToolCallInferenceSchema
from parlant.core.engines.alpha.tool_caller import ToolCallInferenceSchema, ToolCallerInferenceShot
from parlant.core.engines.alpha.guideline_proposer import (
GuidelineProposer,
GuidelinePropositionShot,
GuidelinePropositionsSchema,
)
from parlant.core.engines.alpha.message_event_generator import (
MessageEventGenerator,
MessageEventGeneratorShot,
MessageEventSchema,
)
from parlant.core.engines.alpha.tool_event_generator import ToolEventGenerator
Expand Down Expand Up @@ -345,6 +351,10 @@ async def setup_container(nlp_service_name: str) -> AsyncIterator[Container]:
SchematicGenerator[GuidelineConnectionPropositionsSchema]
] = await nlp_service.get_schematic_generator(GuidelineConnectionPropositionsSchema)

c[ShotCollection[GuidelinePropositionShot]] = guideline_proposer.shot_collection
c[ShotCollection[ToolCallerInferenceShot]] = tool_caller.shot_collection
c[ShotCollection[MessageEventGeneratorShot]] = message_event_generator.shot_collection

c[GuidelineProposer] = GuidelineProposer(
c[Logger],
c[SchematicGenerator[GuidelinePropositionsSchema]],
Expand Down
Loading

0 comments on commit 22cef04

Please sign in to comment.