LogoLogo
Book a DemoWebsite
  • Overview
  • Basics
    • Design Your Data
    • Templates
    • Fields
    • Research Questions
    • Profiles
  • Client
    • Templates
    • Fields
    • Research Questions
    • Profiles
  • API Reference
    • Templates
    • Fields
    • Research Questions
    • Profiles
  • Quick Starts
    • Company
Powered by GitBook
On this page
  • Do It Yourself
  • Let AI Help
  • Status
  1. Client

Templates

Design, structure, and collect key insights critical to your mission.


Do It Yourself

Using the types provided in the client library, we can quickly build a simple template to collect high level information about a company.

from evrim.types.template import Template
from evrim.types.field import Field


# create a template using the provided types
template = Template(
    name="company",
    description="Collect high level information about a company",
    fields=[
        Field(
            name="name",
            description="Official legal name of the company",
            type="str",
        ),
        Field(
            name="description",
            description="A short description of the company",
            type="str",
        ),
        Field(
            name="industry",
            description="The industry the company operates in",
            type="str",
        ),
        Field(
            name="employees",
            description="The number of employees in the company",
            type="int",
        ),
        Field(
            name="website",
            description="The company's website",
            type="str",
        ),
    ],
    questions=["What are the main products or services offered by the company?"]
)

There a few things to call out here:

  • A Template has four important parameters:

    • name: A simple name for your Template based on the entity you're building

    • description: An optional input that helps further understand your intent with this template

    • fields : The structured outputs you'd like to see in your final Profile.

    • questions : Long form research questions that will drive deeper research and produce long form answers.

Let AI Help

Sometimes, you don't want to come up with a Template on your own. Use a simple description of your use case to create a Template, and Evrim will create a detailed Template you get started with or edit yourself.

from evrim import Evrim
import time
import os

client = Evrim(api_token=os.getenv("EVRIM_API_KEY"))
created_prompt_template = client.prompt_templates.create(
    prompt="""
    I am researching a company and need to 
    collect high level information about them
    """
)
# after fast response, wait until operation is completed.
while created_prompt_template.status != "C":
    created_prompt_template = client.prompt_templates.retrieve(prompt_template.id)
    print(f"Prompt template status: {prompt_template.status}")
    time.sleep(5)
else:
    print(f"Prompt template completed: {prompt_template.id}")

Status

This is a good time to mention status in Evrim.

Almost all of Evrim's operations from collection to prompt-generated templates happen in real time, and sometimes, With this in mind, we felt it was important for everything we do to happen in a fashion that feels fast and responsive for our API users.

In the client, status can be one of four different values:

  • W: Waiting to be processed

  • P: Processing

  • C: Completed

  • F: Failed to process

Before putting our Template to use, let's take a second to better understand Evrim's bread and butter, Fields.

PreviousClientNextFields

Last updated 3 months ago

Check out the full to see all available parameters for the Templates.

Operations that take some time come with a status indicator that let's the developer know the individual status of each operation but will always return near instantly to never block the rest of the application. Please see the for in depth details about the different status types.

Client Docs
API Reference