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

Eng 217 local path #220

Merged
merged 6 commits into from
Aug 13, 2024
Merged

Eng 217 local path #220

merged 6 commits into from
Aug 13, 2024

Conversation

thiago-aixplain
Copy link
Collaborator

Treating dictionaries as content local paths as well (related to task https://aixplain.atlassian.net/browse/ENG-108)

query = """You are a proposal writter for the given Request for Proposal (RFP) specialized in @specialization. It should formatted as a markdown file.
RFP: @rfp 
Improve the given proposal given the following guidelines. Guideline: @feedback
Proposal: @proposal
Output just the improved proposal and nothing else."""

content = {
    "@rfp": "rfp.txt",
    "@specialization": "specialization.txt",
    "@feedback": "feedback.txt",
    "@proposal": "proposal.txt",
}

agent = AgentFactory.get("...")
agent.run(query=query, content=content)

@thiago-aixplain thiago-aixplain changed the base branch from main to development August 8, 2024 16:09
@tim-nelson
Copy link
Collaborator

This is great! One consideration, what do you think about using Jinja syntax for Template variables? I.e. {{variable_name}}
(We also use Jinja syntax for variables in Design.)

query = """You are a proposal writter for the given Request for Proposal (RFP) specialized in {{specialization}}. It should formatted as a markdown file.
RFP: {{rfp}}
Improve the given proposal given the following guidelines. Guideline: {{feedback}}
Proposal: {{proposal}}
Output just the improved proposal and nothing else."""

content = {
    "rfp": "rfp.txt",
    "specialization": "specialization.txt",
    "feedback": "feedback.txt",
    "proposal": "proposal.txt",
}

agent = AgentFactory.get("...")
agent.run(query=query, content=content)

@lucas-aixplain
Copy link
Collaborator

This is great! One consideration, what do you think about using Jinja syntax for Template variables? I.e. {{variable_name}} (We also use Jinja syntax for variables in Design.)

query = """You are a proposal writter for the given Request for Proposal (RFP) specialized in {{specialization}}. It should formatted as a markdown file.
RFP: {{rfp}}
Improve the given proposal given the following guidelines. Guideline: {{feedback}}
Proposal: {{proposal}}
Output just the improved proposal and nothing else."""

content = {
    "rfp": "rfp.txt",
    "specialization": "specialization.txt",
    "feedback": "feedback.txt",
    "proposal": "proposal.txt",
}

agent = AgentFactory.get("...")
agent.run(query=query, content=content)

@thiago-aixplain, I agree with @tim-nelson that the depicted format using {{variable_name}} is cleaner to the user. That is also similar to what we're doing in Finetuner prompt template:

prompt_template = """Given the context, generate the continuation:
Context: <<context>>
Continuation: <<continuation>>"""

query += f"\n{input_link}"

if isinstance(content, list):
assert len(content) <= 3, "The maximum number of content inputs is 3."
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tim-nelson, we need to set this max number of content in the documentation.

@thiago-aixplain thiago-aixplain merged commit d0ad51d into development Aug 13, 2024
@thiago-aixplain thiago-aixplain deleted the ENG-217-localPath branch August 13, 2024 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants