- Implementation of specialist execution api, including SSE protocol
- eveai_chat becomes deprecated and should be replaced with SSE - Adaptation of STANDARD_RAG specialist - Base class definition allowing to realise specialists with crewai framework - Implementation of SPIN_SPECIALIST - Implementation of test app for testing specialists (test_specialist_client). Also serves as an example for future SSE-based client - Improvements to startup scripts to better handle and scale multiple connections - Small improvements to the interaction forms and views - Caching implementation improved and augmented with additional caches
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
from typing import Optional, List
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
|
||||
class LeadPersonalInfo(BaseModel):
|
||||
name: Optional[str] = Field(None, description="The full name of the lead.")
|
||||
job_title: Optional[str] = Field(None, description="The job title of the lead.")
|
||||
email: Optional[str] = Field(None, description="The email address of the lead.")
|
||||
phone: Optional[str] = Field(None, description="The phone number of the lead.")
|
||||
additional_info: Optional[str] = Field(None, description="Additional information about the lead.")
|
||||
|
||||
|
||||
class LeadCompanyInfo(BaseModel):
|
||||
company_name: Optional[str] = Field(..., description="The name of the company the lead works for.")
|
||||
company_website: Optional[str] = Field(None, description="The website of the company the lead works for.")
|
||||
industry: Optional[str] = Field(..., description="The industry in which the company operates.")
|
||||
company_size: Optional[int] = Field(..., description="The size of the company in terms of employee count.")
|
||||
additional_info: Optional[str] = Field(None, description="Additional information about the lead's company.")
|
||||
|
||||
|
||||
class LeadInfoOutput(BaseModel):
|
||||
personal_info: Optional[LeadPersonalInfo] = Field(None, description="Personal information of the lead.")
|
||||
company_info: Optional[LeadCompanyInfo] = Field(None, description="Company information related to the lead.")
|
||||
questions: Optional[str] = Field(None, description="Additional questions to further clarify Identification")
|
||||
|
||||
def __str__(self):
|
||||
output = ""
|
||||
if self.personal_info:
|
||||
output += (f"PERSONAL INFO:\n\n"
|
||||
f"Name: {self.personal_info.name or 'N/A'}\n"
|
||||
f"Job Title: {self.personal_info.job_title or 'N/A'}\n"
|
||||
f"Email: {self.personal_info.email or 'N/A'}\n"
|
||||
f"Phone: {self.personal_info.phone or 'N/A'}\n"
|
||||
f"Additional Info: {self.personal_info.additional_info or 'N/A'}\n\n")
|
||||
|
||||
if self.company_info:
|
||||
output += (f"COMPANY INFO:\n\n"
|
||||
f"Company Name: {self.company_info.company_name or 'N/A'}\n"
|
||||
f"Industry: {self.company_info.industry or 'N/A'}\n"
|
||||
f"Company Size: {self.company_info.company_size or 'N/A'}\n"
|
||||
f"Additional Info: {self.company_info.additional_info or 'N/A'}\n\n")
|
||||
|
||||
if self.questions:
|
||||
output += f"QUESTIONS:\n\n{self.questions}\n\n"
|
||||
9
eveai_chat_workers/outputs/rag/rag_v1_0.py
Normal file
9
eveai_chat_workers/outputs/rag/rag_v1_0.py
Normal file
@@ -0,0 +1,9 @@
|
||||
from typing import List, Optional
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
|
||||
class RAGOutput(BaseModel):
|
||||
answer: Optional[str] = Field(None, description="Answer to the questions asked")
|
||||
citations: Optional[List[str]] = Field(None, description="A list of sources used in generating the answer")
|
||||
insufficient_info: Optional[bool] = Field(None, description="An indication if there's insufficient information to answer")
|
||||
24
eveai_chat_workers/outputs/spin/spin_v1_0.py
Normal file
24
eveai_chat_workers/outputs/spin/spin_v1_0.py
Normal file
@@ -0,0 +1,24 @@
|
||||
from typing import List, Optional
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
|
||||
class SPINOutput(BaseModel):
|
||||
situation: Optional[str] = Field(None, description="Situation information")
|
||||
problem: Optional[str] = Field(None, description="Problem information")
|
||||
implication: Optional[str] = Field(None, description="Implication information")
|
||||
need: Optional[str] = Field(None, description="Need-payoff information")
|
||||
additional_info: Optional[str] = Field(None, description="Additional sales-related information.")
|
||||
questions: Optional[str] = Field(None, description="Additional questions to further clarify SPIN")
|
||||
potential_customer: Optional[bool] = Field(False, description="Indication if this could be a good customer")
|
||||
|
||||
def __str__(self):
|
||||
"""Custom string output for usage in agents and tasks"""
|
||||
return (f"Situation: {self.situation or 'N/A'}\n"
|
||||
f"Problem: {self.problem or 'N/A'}\n"
|
||||
f"Implication: {self.implication or 'N/A'}\n"
|
||||
f"Need: {self.need or 'N/A'}\n"
|
||||
f"Additional Info: {self.additional_info or 'N/A'}\n"
|
||||
f"Questions: {self.questions or 'N/A'}\n"
|
||||
f"Potential Customer: {self.potential_customer or 'N/A'}\n")
|
||||
|
||||
Reference in New Issue
Block a user