Automationscribe.com
  • Home
  • AI Scribe
  • AI Tools
  • Artificial Intelligence
  • Contact Us
No Result
View All Result
Automation Scribe
  • Home
  • AI Scribe
  • AI Tools
  • Artificial Intelligence
  • Contact Us
No Result
View All Result
Automationscribe.com
No Result
View All Result

How SailPoint makes use of Anthropic’s Claude on Amazon Bedrock to robotically generate TypeScript code for SaaS connectors

admin by admin
October 17, 2024
in Artificial Intelligence
0
How SailPoint makes use of Anthropic’s Claude on Amazon Bedrock to robotically generate TypeScript code for SaaS connectors
399
SHARES
2.3k
VIEWS
Share on FacebookShare on Twitter


Generative AI is revolutionizing the way in which builders strategy programming by offering clever help and automation all through the coding course of. With the ability of superior language fashions and machine studying (ML) algorithms, generative AI can perceive the context and intent behind a programmer’s code, providing precious options, finishing code snippets, and even producing complete features or modules based mostly on high-level descriptions. This know-how empowers builders to deal with higher-level problem-solving and structure, whereas the AI handles the tedious and repetitive features of coding. One of many key benefits of huge language fashions (LLMs) in programming is their capability to study from the huge quantities of current code and programming patterns they had been skilled on. This data permits them to generate context-aware code, detect potential bugs or vulnerabilities, and provide optimizations to enhance code high quality and efficiency.

On this put up, we spotlight how the AWS Generative AI Innovation Middle collaborated with SailPoint Applied sciences to construct a generative AI-based coding assistant that makes use of Anthropic’s Claude Sonnet on Amazon Bedrock to assist speed up the event of software program as a service (SaaS) connectors.

Amazon Bedrock is a totally managed service that provides a selection of high-performing basis fashions (FMs) from main AI corporations like AI21 Labs, Anthropic, Cohere, Meta, Mistral AI, Stability AI, and Amazon by way of a single API, together with a broad set of capabilities to construct generative AI purposes with safety, privateness, and accountable AI.

SailPoint makes a speciality of enterprise id safety options. Over 3,000 enterprises worldwide use SailPoint to assist defend towards in the present day’s dynamic, identity-centric cyber threats whereas enhancing productiveness and effectivity. Their merchandise are designed to handle and safe entry to purposes and information by way of the lens of id, at velocity and scale, for customers inside a company and for exterior events resembling non-employees. SailPoint’s unified, clever, and extensible atmosphere offers complete id governance capabilities, together with entry certifications, coverage administration, entry request and provisioning, password administration, and information entry governance. This helps organizations ensure the correct people have the correct entry to the correct sources on the proper instances, thereby implementing safety insurance policies and compliance necessities. Based in 2005, SailPoint has grown to be a key participant in id safety, serving clients globally throughout varied industries.

SailPoint connectors and SaaS connectivity

SailPoint’s id safety options interface with varied software program as a service (SaaS) purposes to retrieve the required info, resembling account and entry info, from an id safety standpoint. Every SaaS software implements these functionalities in barely alternative ways and may expose their implementation by way of REST-based net APIs which can be sometimes supported by OpenAPI specs. SailPoint connectors are TypeScript modules that interface with a SaaS software and map the related id safety info (resembling accounts and entitlements) to a standardized format understood by SailPoint. Based mostly on the APIs uncovered by the applying, SailPoint connectors can create, replace, and delete entry on these accounts. SailPoint connectors assist handle person identities and their entry rights throughout completely different environments inside a company, supporting the group’s compliance and safety efforts.

Though a typical connector exposes a number of features, for this put up, we deal with growing the listing person operate of a connector that connects to an API endpoint for itemizing customers, retrieving all of the customers, and reworking them into the format required by SailPoint.

Within the following sections, we element how we used Anthropic’s Claude Sonnet on Amazon Bedrock to robotically create the listing person connector, a crucial element of the broader SaaS connectivity.

Understanding the listing person connector

Connectors are modules that may hook up with an exterior service and retrieve and replace related info from a SaaS software. To higher perceive how connectors are constructed, we give an instance of the connector operate that connects to DocuSign’s REST API’s getUsers endpoint. The next TypeScript code defines an asynchronous operate listUsers that retrieves a listing of person accounts from an exterior API and constructs a structured output for every person:

// imports
import { Context, Response, StdAccountListHandler, StdAccountListOutput } from '@sailpoint/connector-sdk';

const listUsers: StdAccountListHandler = async (context: Context, enter: undefined, res: Response) => {
    // retrieve api key and host url from context
    let apiKey = context.apiKey;
    let hostUrl = context.hostUrl;
    let hasMore = true;
    
    // url building
    let url = `https://${hostUrl}/Administration/v2/organizations/${context.organizationId}/customers`;
    
    // loop by way of pages
    whereas (hasMore) {
        // fetch response from the endpoint
        let response = await fetch(url, {
          headers: {
            'Authorization': `Bearer ${apiKey}`
          }
        });
        let outcomes = await response.json();
  
        // processing customers from response
        let customers = outcomes.customers;
        for (const person of customers) {
            const output: StdAccountListOutput = {
                id: person.id,
                attributes: {
                    user_name: person.user_name,
                    first_name: person.first_name,
                    last_name: person.last_name,
                    user_status: person.user_status, 
                    membership_status: person.membership_status, 
                    electronic mail: person.electronic mail,
                    created_on: person.created_on, 
                    membership_created_on: person.membership_created_on,                     
                    ds_group_id: person.company_groups.map(group => group.ds_group_id),
                    ds_group_account_id: person.company_groups.map(group => group.ds_group_account_id)                   
                }
            };
        }
        // pagination
        if (outcomes.paging.subsequent) {
          url = outcomes.paging.subsequent;
        } else {
          hasMore = false;
        }
    }
}

The next is a breakdown of what every a part of the code does:

  • Imports – The code imports a number of sorts and interfaces from @sailpoint/connector-sdk. These embrace Context, Response, StdAccountListHandler, and StdAccountListOutput, that are used to deal with the enter and output of the operate in a standardized means inside a SailPoint atmosphere.
  • Perform definition – listUsers is outlined as an asynchronous operate suitable with the StdAccountListHandler It makes use of the Context to entry configuration particulars like API keys and the bottom URL, and a Response to construction the output.
  • Retrieve API key and host URL – These are extracted from the context parameter. They’re used to authenticate and assemble the request URL.
  • URL building – The operate constructs the preliminary URL utilizing the hostUrl and organizationId from the context. This URL factors to an endpoint that returns customers related to a selected group.
  • Loop by way of pages – The whereas loop continues so long as there are extra pages of information (hasMore is true). It serves the next features:
    • Fetch information – Contained in the whereas loop, a fetch request is made to the API endpoint. The request contains an Authorization header that makes use of the apiKey. The API’s response is transformed to JSON format.
    • Course of customers – Contained in the whereas loop, it extracts person information from the API response. The method loops by way of every person, developing an StdAccountListOutput object for each. This object contains person identifiers and attributes like person names, names, standing, electronic mail, and group IDs.
    • Pagination – Contained in the whereas loop, it checks if there’s a subsequent web page URL within the pagination info (outcomes.paging.subsequent). If it exists, it updates the url for the following iteration of the loop. If not, it units hasMore to false to cease the loop.

Understanding this instance helps us perceive the step-by-step strategy of constructing this operate in a connector. We goal to breed this course of utilizing an LLM with a immediate chaining technique.

Generate a TypeScript connector utilizing an LLM immediate chain

There are a number of approaches to utilizing pre-trained LLMs for code technology, with various ranges of complexity:

  • Single immediate – You should use fashions like Anthropic’s Claude to generate code by direct prompting. These fashions can generate code in quite a lot of languages, together with TypeScript, however they don’t inherently possess domain-specific information related to the duty of constructing a connector. All of the required info, together with API specs and formatting directions, have to be supplied within the immediate, much like the directions that might be given to a developer. Nevertheless, LLMs are inclined to battle when given an extended listing of advanced directions. It’s additionally tough for the immediate engineer to know which steps are difficult for the LLM.
  • Agentic frameworks with LLMs – Brokers are a complicated framework that may use instruments to carry out a sequence of advanced duties. On this case, the agent begins by breaking down the person requests into steps, searches for obligatory info utilizing instruments (a information base or net browser), and autonomously generates code from begin to end. Though they’re highly effective, these frameworks are advanced to implement, typically unstable of their conduct, and fewer controllable in comparison with different strategies. Brokers additionally require many LLM calls to carry out a job, which makes them relatively gradual in observe. Within the case the place the logic to carry out a job is a set sequence of steps, brokers usually are not an environment friendly choice.
  • Immediate chain – An answer that finds trade-off between the 2 earlier approaches includes utilizing a immediate chaining method. This technique breaks the advanced downside right into a sequence of extra manageable steps and integrates them to craft the ultimate code. Every step has clear directions which can be simpler for the LLM to observe, and a human within the loop can management the output of every step and proper the LLM if wanted. This strategy strikes a steadiness between flexibility and management, avoiding the extremes of the opposite two strategies.

We initially examined the LLM’s capability to generate connector code based mostly on a single immediate and realized that it struggles to generate code that addresses all features of the issue, resembling pagination or nested information constructions. To verify the LLM would cowl all the required elements of the connector features, and since making a connector follows a set sequence of steps, immediate chaining was essentially the most pure strategy to enhance the generated code.

The chain we used for connector technology consists of the next high-level steps:

  1. Parse the information mannequin of the API response into prescribed TypeScript courses.
  2. Generate the operate for person flattening within the format anticipated by the connector interface.
  3. Perceive the pagination of the API specs and formulate a high-level resolution.
  4. Generate the code for the ListUsers operate by combining all of the intermediate steps.

Step 1 is used as an enter to Step 2, however Step 3 is separate. Each Step 2 and Step 3 outcomes are fed to Step 4 for the ultimate outcome. The next diagram illustrates this workflow.

Within the following sections, we are going to dive into the prompting methods we used for every of those steps.

System immediate

The system immediate is an integral part of LLM prompting that sometimes offers the preliminary context to information the mannequin’s response. For all of the prompts within the chain, we used the next system immediate:

"""
You're an professional net developer who has a wonderful understanding of REST APIs and backend
API growth utilizing TypeScript. Your purpose is to know API specification supplied in 
OpenAPI specification or Swagger specification as YAML recordsdata and to write down TypeScript code,
XML, API descriptions and so forth. as requested within the job description. Don't deviate from the 
supplied specification and documentation and if one thing is unclear within the specification then 
point out your uncertainty within the feedback don't make up info that isn't accessible in 
the specs or description.

When writing TypeScript code, present minimal however significant feedback.
"""

Extra particularly, the system immediate is used to determine the function of the LLM (professional net developer), give it a common purpose (perceive API specs and write TypeScript code), give high-level directions (add feedback within the code) and set boundaries (don’t make up info).

Information mannequin parsing

On this step, we immediate the LLM to know the construction of the API response and create TypeScript courses akin to the objects within the response. Though this step isn’t strictly obligatory for producing the response, it could assist the LLM immensely in producing an accurate connector. Just like chain-of-thought reasoning for arithmetic issues, it’s forcing the LLM to “assume” earlier than responding.

This step affords two main advantages:

  • Verbose API response simplification – API responses specified within the documentation might be fairly verbose. By changing the response construction into TypeScript courses, we compress the data into fewer traces of code, making it extra concise and simpler for the LLM to understand. This step helps be sure that the important info is prominently displayed firstly.
  • Dealing with fragmented person responses – In some APIs, the person response consists of a number of fragments due to the reuse of information constructions. The OpenAPI specification makes use of the $ref tag to reference these reusable elements. By changing the person response into TypeScript courses, we will consolidate all of the related info right into a single location. This consolidation simplifies the downstream steps by offering a centralized supply of knowledge.

We use the next job immediate to transform the API response into prescribed TypeScript courses:

"""
You're given an API spec of OpenAPI or Swagger for a REST API endpoint
that serves a listing of customers for Software program as a Service (SaaS) software. You'll 
be requested to extract the construction of the Person within the JSON response from the API endpoint. 

Right here is the API spec supplied between the XML tags  . 
Perceive and keep in mind the API spec effectively.


{api_spec}


Use the next directions to create TypeScript interfaces based mostly on the construction 
of the Person. 

- Present the code in between   XML tags. 
- If there are any nested objects, develop them into their very own interfaces.
- Be complete and embrace all attributes.
- Retrieve all attributes, together with these marked as not necessary, not required, or nullable.
- The attributes are listed underneath `properties` part.
- Output just one Person interface that features all of the attributes from any interfaces it extends.


The anticipated format of the output is as follows: 
 
// Person
interface Person {{
  id: quantity;
  first_name: string;
  last_name: string;
  electronic mail: string;
  is_active: boolean;
  company_groups_ids: quantity[];
  other_attribute: string;
  nested_type: NestedType[];
}}

// Some advanced kind
interface NestedType {{
    type_id: string;
    some_string_attribute: string;
    some_number_attribute: quantity;
}}


"""

Within the previous immediate template, the variable {api_spec} is changed with the API specification of the endpoint. A selected instance for a DocuSign ListUsers endpoint is supplied within the appendix.

The next code is an instance of the LLM-generated courses when utilized to the DocuSign API specs. This has been parsed out of the tags.

// Person
interface Person  'closed'
    membership_status: string; // Considered one of: 'activation_required' 
  
// DsGroup
interface DsGroup {
    ds_group_id: string; // format: uuid
    account_id: string; // format: uuid
    source_product_name: string;
    group_id: string;
    group_name: string;
    description: string;
    is_admin: boolean;
    last_modified_on: string; // format: date-time
    user_count: quantity; // format: int32
    external_account_id: quantity; // format: int64
    account_name: string;
    membership_id: string; // format: uuid
}

Person flattening operate technology

The anticipated construction for every person is an object consisting of two properties: an identifier and a dictionary of attributes. The attributes dictionary is a map that associates string keys with both primitive attributes (quantity, Boolean, or string) or an array of primitive attributes. due to the potential for arbitrarily nested JSON object constructions within the response, we use the capabilities of an LLM to generate a person flattening and conversion operate. Each the person ID and the attributes are extracted from the response. By using this strategy, we successfully separate the intricate job of changing the person construction from the REST API response into the required format for the SailPoint connector SDK (hereafter known as the connector SDK).

The advantages of this strategy are twofold. First, it permits for a cleaner and extra modular code design, as a result of the advanced conversion course of is abstracted away from the primary code base. Second, it allows higher flexibility and flexibility, as a result of the conversion operate might be modified or regenerated to accommodate adjustments within the API response construction or the connector SDK necessities, with out necessitating intensive modifications to the encircling code base.

We use the next immediate to generate the conversion operate, which takes as enter the information mannequin generated within the earlier step:

"""
Perceive and keep in mind the next information mannequin supplied 
as a set of TypeScript class definitions.
You can be required to generate a TypeScript operate based mostly on the 
information mannequin supplied between   XML tags.


{data_model}


DO NOT use the TypeScript interfaces outlined above within the code you write, 
as they are going to be unavailable. Substitute them with the kind `any` the place required 
to write down code that works with strict TypeScript.

Given the TypeScript class definitions and information mannequin above, your targets is to
write a TypeScript operate that transforms the person into an object containing two
keys - an `id` and `attributes`. The attributes is a listing of attributes
aside from the identifier attribute.

Listed here are the principles for mapping attributes from the person object to attributes area:


- The operate takes in a person and return StdAccountListOutput.
- Extract all attributes specified within the person schema above within the 
- attributes can solely include both primitives values or array of primitive values.
- Decide the kind of the attribute from the  above. Don't guess it from the
names of the attributes. E.g. if the identify is plural do not assume it's an array.
- All primitive attributes resembling string and numbers are copied with out transformation.
- All arrays of primitive attributes are copied with out transformation.
- All objects are flattened out and their attributes are copied as easy attributes.
- All arrays of objects are transformed into a number of attributes the place every attribute is an array of primitive kind. 
See additional instruction beneath between the XML tags .
- Use `any` kind in features and arrow operate definitions in order that it really works with TypeScript.





Take into account the next construction of the response the place `obj_array` is an attribute that's array of objects of kind `MyObj`.
Then within the flattening course of, for the response, you will want to transform the `obj_array` attribute 
into a number of attributes like `obj_array_attribute1`, `obj_array_attribute2` every of which is an array of strings on this case.

interface Person {{
  id: string; // format: uuid
  user_name: string;
  first_name: string;
  obj_array: MyObject[];
}}

interface MyObj {{
  attribute1: string; // format: uuid
  attribute2: string; // format: uuid
  attribute3: string;
}}
 


Output the code in response to the template program beneath enclosed between the  XML tags.

This operate is an element of a bigger program so preserve the StdAccountListOutput within the operate as it's.
Don't overcomplicate and write easy, effectively readable code. 



operate flattenUser(person: any): StdAccountListOutput {{
  return {{
    id: person.id,
    attributes: {{
      first_name: person.first_name,
      last_name: person.last_name,
      user_type: person.kind,
      login: person.login,
      electronic mail: person.electronic mail,
      location: person.location,
      employee_id: person.employee_id,
      reviewer_id: person.reviewer_id,
      is_active: person.is_active,
      struct_array_attribute: person.struct_array.map( (val: any) => val.struct_attribute)
    }}
  }}
}};


"""

Within the previous immediate template, we change the {data_model} variable with the information mannequin of TypeScript courses extracted within the earlier technology step of parsing the information mannequin.

The next code is an instance of the LLM-generated person flattening operate when utilized to the DocuSign API:

operate flattenUser(person: any): StdAccountListOutput {
    const id = person.id;
    const attributes: { [key: string]: any } = {};
  
    // Copy primitive attributes
    attributes.user_name = person.user_name;
    attributes.first_name = person.first_name;
    attributes.last_name = person.last_name;
    attributes.user_status = person.user_status;
    attributes.membership_status = person.membership_status;
    attributes.electronic mail = person.electronic mail;
    attributes.created_on = person.created_on;
    attributes.membership_created_on = person.membership_created_on;
  
    // Convert array of objects to a number of attributes
    const dsGroupAttributes: { [key: string]: any[] } = {};
    person.ds_groups.forEach((dsGroup: any) =>  [];
      dsGroupAttributes.account_id.push(dsGroup.account_id);
  
      dsGroupAttributes.source_product_name = dsGroupAttributes.source_product_name );
  
    Object.assign(attributes, dsGroupAttributes);
  
    return {
      id,
      attributes
    };
}

Pagination understanding

As talked about earlier, the REST API can implement a number of pagination schemes. Usually, the pagination particulars aren’t explicitly talked about. Throughout the growth of the chain, we discovered that when there are a number of pagination schemes, the LLM would combine up parts of various pagination schemes and output code that isn’t coherent and generally additionally incorporates errors. As a result of looping over the paged outcomes is an important step, we separate out this step within the code technology to let the LLM perceive the pagination scheme carried out by the API and formulate its response at a excessive stage earlier than outputting the code. This permits the LLM to assume step-by-step in formulating the response. This step generates the intermediate reasoning, which is fed into the following and closing step: producing the listing customers operate code.

We use the next immediate to get the pagination logic. As a result of we’re utilizing Anthropic’s Claude Sonnet on Amazon Bedrock, we ask the LLM to output the logic in XML format, which is understood to be an environment friendly strategy to construction info for that mannequin.

"""
Perceive and keep in mind the next OpenAPI specification supplied between the
  XML tags. You'll reply questions based mostly on this specification,
which describes an endpoint for itemizing customers from a SaaS software. 


{api_spec}


Along with the specification, use the next details about the API to 
perceive the small print that aren't accessible within the spec. The small print
are included in between XML tags  .


{api_info}


The listing customers API is used to acquire a listing of customers from the API. This API
might implement a number of pagination schemes to retrieve the listing of customers. 
Pagination is used to retrieve pages of outcomes separately as a substitute of 
.

Your purpose is to know the a number of pagination schemes carried out 
within the API finish level and use the only scheme to loop over the pages
to retrieve all of the customers. 

First describe in particulars how the pagination is carried out by the API 
in a step-by-step method. Embody the small print of tips on how to get the primary 
web page after which tips on how to get the following pages. Present the output in between
the XML tags  . If the API doesn't 
implement pagination then output "No pagination carried out".

If the API implements a number of pagination schemes: 
- Choose the best scheme and implement utilizing solely that one scheme. 
- If the API response incorporates a subsequent URL both within the response physique or the 
headers, favor that pagination scheme over extra advanced offset-based schemes.

If there may be inadequate or lacking info within the specs then don't
make up or guess it. Specify it within the output.

Output the leads to the next format


     listing all of the pagination schemes 
     choose one scheme to implement looping 
     steps to get first web page 
     steps to get subsequent web page 
     situation for exiting loop 
     sure/no 

"""

Within the previous immediate template, the variable {api_spec} is changed with the API specification. An instance of the DocuSign API is supplied within the appendix on the finish of this put up. The variable {api_info} might be changed with extra API documentation in pure language, which is left as an empty string within the DocuSign instance.

The next is the LLM’s response for the pagination logic extraction within the case of the DocuSign API, parsed out of the tags:

"""

1. Offset-based pagination utilizing the beginning and take question parameters. 
2. Index-based pagination utilizing the beginning and finish question parameters. 
3. Hyperlink-based pagination utilizing the following and former hyperlinks within the response.



Hyperlink-based pagination utilizing the following and former hyperlinks within the response.



1. Make a GET request to the /v2/organizations/{organizationId}/customers endpoint with none pagination parameters. 
2. The response will include the primary web page of outcomes and a subsequent hyperlink for the following web page (if there are extra outcomes).



1. Test if the response incorporates a subsequent hyperlink. 
2. If the following hyperlink is current, make a GET request to the URL supplied within the subsequent hyperlink. 
3. The response will include the following web page of outcomes and a subsequent hyperlink for the following web page (if there are extra outcomes).



Proceed making requests to the following hyperlink till the response not incorporates a subsequent hyperlink, indicating that there aren't any extra pages.



sure

"""

ListUsers operate technology

This closing step within the chain combines the data extracted within the earlier steps along with the person flattening operate generated within the earlier steps to formulate the ultimate response, which is the TypeScript operate that retrieves a listing of customers from the supplied API.

We use the next immediate to generate the whole TypeScript operate:

"""
Your job is to write down a TypeScript program to retrieve a listing of customers from REST API. Detailed
directions for the duty are supplied beneath. The API sometimes returns a set of customers at a
time, you'll have to paginate by way of the outcomes to retrieve all customers whereas there are extra 
outcomes remaining.

Perceive and keep in mind the next OpenAPI YAML specification supplied between the
  XML tags you can be requested to write down a TypeScript program based mostly on it.


{api_spec}


Along with the specs the next documentation and implementation particulars in regards to the
API are supplied in between the XML tags  .


{api_info}


The next pagination logic laid out in between   XML 
tags offers excessive stage particulars on  tips on how to implement looping over paginated outcomes to retrieve 
all of the customers. Choose the pagination in response to the choice mentions within the pagination logic beneath.


{pagination_logic}



Now, implement a TypeScript operate that retrieves all of the customers following the directions beneath

- Don't modify the `flattenUser` operate and reproduce it as it's.
- Change solely the BODY of `listUsers` operate however don't modify the operate signature as it's
a part of the massive program that expects this operate signature.
- Don't create or invent any new sorts.
- For pagination adhere to the directions supplied in  and 
- If pagination requires variety of outcomes, then fetch 50 customers at a time.
- Assume that `context.hostUrl` from the enter context will present the API hostname and port within the 
format "hostname:port_number" or "host_ip_address:port_number".
- If the API makes use of a Hyperlink based mostly pagination you then sometimes don't must reconstruct the url utilizing
`hostUrl` as the whole hyperlink can be supplied within the subsequent url or within the hyperlink headers.
- change the `endpoint_url` with the endpoint url supplied within the specs.
- You'll be able to assume that any required values resembling `apiKey` can be supplied within the `context` variable.
- Change the authorization headers to match the data within the headers.
- Assume that any parameters which can be required to assemble the trail are equipped by way of `context` variable. The names of such variable 
will match precisely with the variable specified within the templated path within the API specs.


Right here is the instance output


import {{ Context, Response, StdAccountListHandler, StdAccountListOutput }} from '@sailpoint/connector-sdk';

{flatten_user_function}

const listUsers: StdAccountListHandler = async (context: Context, enter: undefined, res: Response) => {{
    let apiKey = context.apiKey;
    let hostUrl = context.hostUrl;
    let hasMore = true;

    let url="http://${{hostUrl}}/{{endpoint_path}}";
    whereas (hasMore) {{

        // fetch response from the endpoint
        let response = await fetch(url, {{
          headers: {{
            'Authorization': `${{apiKey}}`
          }}
        }});
        let outcomes = await response.json();

        // get the customers from the returned outcomes
        let customers = outcomes.customers;
        for (let person of customers) {{
            flattened_user = flattenUser(person)
            res.ship(flattened_user);
        }}

        // Set the url to the "subsequent" URL from the response whether it is accessible
        if (outcomes.subsequent) {{
          url = outcomes.subsequent;
        }} else {{
          hasMore = false;
        }}
    }}
}}


Output the generated code between the XML tags   and 
solely output the code with none extra formatting like triple quotes.
"""

On this immediate, we change {flatten_user_function} with the flattenUser that was generated earlier and {pagination_logic} with the one which was generated earlier. We offer a template for the listUsers operate to ensure the ultimate output meets the necessities for the connector operate. The ensuing output is the next listUsers operate, which makes use of the flattenUser operate from earlier:

const listAccounts: StdAccountListHandler = async (context: Context, enter: undefined, res: Response) => {
    let apiKey = context.apiKey;
    let hostUrl = context.hostUrl;
    let organizationId = context.organizationId;
    let hasMore = true;

    let url = `https://${hostUrl}/Administration/v2/organizations/${organizationId}/customers`;
    whereas (hasMore) {

        // fetch response from the endpoint
        let response = await fetch(url, {
          headers: {
            'Authorization': `Bearer ${apiKey}`
          }
        });
        let outcomes = await response.json();

        // get the customers from the returned outcomes
        let customers = outcomes.customers;
        for (let person of customers) {
            let flattened_user = flattenUser(person)
            res.ship(flattened_user);
        }

        // Set the url to the "subsequent" URL from the response whether it is accessible
        if (outcomes.paging.subsequent) {
          url = outcomes.paging.subsequent;
        } else {
          hasMore = false;
        }
    }
}

Classes realized

On this put up, we demonstrated how LLMs can deal with advanced code technology issues by using varied core prompting rules and the immediate chaining method. Though LLMs excel at following clearly outlined directions and producing small code snippets, this use case concerned a considerable quantity of contextual info within the type of API specs and person directions. Our findings from this train are the next:

  • Decomposing advanced issues – Breaking down a posh code technology downside into a number of intermediate steps of decrease complexity enhances the LLM’s efficiency. Offering a single advanced immediate may end up in the LLM lacking some directions. The immediate chaining strategy enhances the robustness of the technology, sustaining higher adherence to directions.
  • Iterative optimization – This technique permits for iterative optimization of intermediate steps. Every a part of the chain might be refined independently earlier than transferring to the following step. LLMs might be delicate to minor adjustments in directions, and adjusting one facet can unintentionally have an effect on different targets. Immediate chaining affords a scientific strategy to optimize every step independently.
  • Dealing with advanced selections – Within the part on understanding pagination, we illustrated how LLMs can purpose by way of varied choices and make advanced selections earlier than producing code. As an illustration, when the enter API specification helps a number of pagination schemes, we prompted the LLM to determine on the pagination strategy earlier than implementing the code. With direct code technology, with out utilizing an intermediate reasoning step, the LLM tended to combine parts of various pagination schemes, leading to inconsistent output. By forcing decision-making first, in pure language, we achieved extra constant and correct code technology.

By means of automated code technology, SailPoint was capable of dramatically scale back connector growth time from hours or days to mere minutes. The strategy additionally democratizes code growth, so that you don’t want deep TypeScript experience or intimate familiarity with SailPoint’s connector SDK. By accelerating connector technology, SailPoint considerably shortens the general buyer onboarding course of. This streamlined workflow not solely saves precious developer time but additionally allows sooner integration of numerous programs, in the end permitting clients to make use of SailPoint’s id safety options extra quickly and successfully.

Conclusion

Our AI-powered resolution for producing connector code opens up new potentialities for integrating with REST APIs. By automating the creation of connectors from API specs, builders can quickly construct strong connections to any REST API, saving developer time and lowering the time to worth for onboarding new clients. As demonstrated on this put up, this know-how can considerably streamline the method of working with numerous APIs, permitting groups to deal with utilizing the information and performance these APIs present relatively than getting overwhelmed by connector code particulars. Take into account how such an answer may improve your individual API integration efforts—it might be the important thing to extra environment friendly and efficient use of the myriad APIs accessible in in the present day’s interconnected digital panorama.


In regards to the Authors

Erik Huckle is the product lead for AI at SailPoint, the place he works to unravel crucial buyer issues within the id safety ecosystem by way of generative AI and information applied sciences. Previous to SailPoint, Erik co-founded a startup in robotic automation and later joined AWS as the primary product rent at Amazon One. Erik mentors native startups and serves as a board member and tech committee lead for a EdTech nonprofit group.

Tyler McDonnell is the engineering head of AI at SailPoint, the place he leads the event of AI options to drive innovation and impression in id safety world. Previous to SailPoint, Tyler led machine studying analysis and engineering groups at a number of early to late-stage startups and revealed work in domains spanning software program upkeep, info retrieval, and deep studying. He’s obsessed with constructing merchandise that use AI to carry constructive impression to actual individuals and issues.

Anveshi Charuvaka is a Senior Utilized Scientist on the Generative AI Innovation Middle, the place he helps clients undertake Generative AI by implementing options for his or her crucial enterprise challenges. With a PhD in Machine Studying and over a decade of expertise, he makes a speciality of making use of modern machine studying and generative AI methods to deal with advanced real-world issues.

Aude Genevay is a Senior Utilized Scientist on the Generative AI Innovation Middle, the place she helps clients deal with crucial enterprise challenges and create worth utilizing generative AI. She holds a PhD in theoretical machine studying and enjoys turning cutting-edge analysis into real-world options.

Mofijul Islam is an Utilized Scientist II on the AWS Generative AI Innovation Middle, the place he helps clients deal with advanced, customer-centric analysis challenges utilizing generative AI, giant language fashions (LLM), multi-agent studying, and multimodal studying. He holds a PhD in machine studying from the College of Virginia, the place his work centered on multimodal machine studying, multilingual NLP, and multitask studying. His analysis has been revealed in top-tier conferences like NeurIPS, ICLR, AISTATS, and AAAI, in addition to IEEE and ACM Transactions.

Yasin Khatami is a Senior Utilized Scientist on the Generative AI Innovation Middle. With greater than a decade of expertise in synthetic intelligence (AI), he implements state-of-the-art AI merchandise for AWS clients to drive effectivity and worth for buyer platforms. His experience is in generative AI, giant language fashions (LLM), multi-agent methods, and multimodal studying.

Karthik Ram is a Principal Options Architect with Amazon Net Providers based mostly in Columbus, Ohio. He works with Impartial Software program Distributors (ISVs) to construct safe and modern cloud options, together with serving to with their merchandise and fixing their enterprise issues utilizing data-driven approaches. Karthik’s space of depth is Cloud Safety with a deal with Infrastructure Safety and menace detection.


Appendix

The next API specs had been used for the experiments on this put up:

Copyright (c) 2017- DocuSign, Inc. (https://www.docusign.com)
swagger: '2.0'
data:
  title: DocuSign API
  model: v2.1
host: api.docusign.web
basePath: "/Administration"
schemes:
- https
consumes:
- software/json
produces:
- software/json
paths:
  "/v2/organizations/{organizationId}/customers":
    get:
      tags:
      - Customers
      abstract: Returns details about the customers in a company.
      description: |-
        Returns details about the customers in a company.

        You could embrace at the very least one of many following question parameters within the request:

        - `account_id`: The ID of an account related to the group.
        - `organization_reserved_domain_id`: The ID of one of many group's reserved domains.
        - `electronic mail`: An electronic mail deal with related to the customers that you simply need to return.
      operationId: OrganizationUser_OrganizationUsers_GetV2
      produces:
      - software/json
      parameters:
      - identify: organizationId
        in: path
        description: The group ID Guid
        required: true
        kind: string
        format: uuid
      - identify: begin
        in: question
        description: Index of first merchandise to incorporate within the response. The default worth
          is 0.
        required: false
        kind: integer
        format: int32
      - identify: take
        in: question
        description: Web page measurement of the response. The default worth is 20.
        required: false
        kind: integer
        format: int32
      - identify: finish
        in: question
        description: Index of the final merchandise to incorporate within the response. Ignored if
          `take` parameter is specified.
        required: false
        kind: integer
        format: int32
      - identify: electronic mail
        in: question
        description: E-mail deal with of the specified person. At the least certainly one of `electronic mail`, `account_id`
          or `organization_reserved_domain_id` have to be specified.
        required: false
        kind: string
      - identify: email_user_name_like
        in: question
        description: Selects customers by sample matching on the person's electronic mail deal with
        required: false
        kind: string
      - identify: standing
        in: question
        description: Standing.
        required: false
        kind: string
      - identify: membership_status
        in: question
        description: |
          The person's membership standing. Considered one of:

          - `activation_required`
          - `activation_sent`
          - `energetic`
          - `closed`
          - `disabled`
        required: false
        kind: string
      - identify: account_id
        in: question
        description: Choose customers which can be members of the required account. At the least
          certainly one of `electronic mail`, `account_id` or `organization_reserved_domain_id` have to be
          specified.
        required: false
        kind: string
        format: uuid
      - identify: organization_reserved_domain_id
        in: question
        description: Choose customers which can be within the specified area. At the least certainly one of
          `electronic mail`, `account_id` or `organization_reserved_domain_id` have to be specified.
        required: false
        kind: string
        format: uuid
      - identify: last_modified_since
        in: question
        description: Choose customers whose information have been modified because the date specified.
          `account_id` or `organization_reserved_domain_id` have to be specified.
        required: false
        kind: string
      responses:
        '200':
          description: OK
          schema:
            kind: object
            properties:
              customers:
                kind: array
                objects:
                  kind: object
                  properties:
                    id:
                      format: uuid
                      kind: string
                      instance: 00000000-0000-0000-0000-000000000000
                      description: The person's distinctive ID.
                    user_name:
                      kind: string
                      description: The complete identify of the person.
                    first_name:
                      kind: string
                      description: The person's first identify.
                    last_name:
                      kind: string
                      description: The person's final identify.
                    user_status:
                      kind: string
                      description: |
                        The person's standing. Considered one of:

                        - `energetic`
                        - `created`
                        - `closed`
                    membership_status:
                      kind: string
                      description: |
                        The person's membership standing. Considered one of:

                        - `activation_required`
                        - `activation_sent`
                        - `energetic`
                        - `closed`
                        - `disabled`
                    electronic mail:
                      kind: string
                      description: The e-mail deal with.
                    created_on:
                      format: date-time
                      kind: string
                      description: The date the person's account was created.
                    membership_created_on:
                      format: date-time
                      kind: string
                      description: The date on which the person turned a member of the group.
                    ds_groups:
                      kind: array
                      objects:
                        kind: object
                        properties:
                          ds_group_id:
                            format: uuid
                            kind: string
                            instance: 00000000-0000-0000-0000-000000000000
                            description: ''
                          account_id:
                            format: uuid
                            kind: string
                            instance: 00000000-0000-0000-0000-000000000000
                            description: Choose customers which can be members of the required account. At the least
                              certainly one of `electronic mail`, `account_id` or `organization_reserved_domain_id` have to be
                              specified.
                          source_product_name:
                            kind: string
                          group_id:
                            kind: string
                          group_name:
                            kind: string
                          description:
                            kind: string
                          is_admin:
                            kind: boolean
                          last_modified_on:
                            format: date-time
                            kind: string
                          user_count:
                            format: int32
                            kind: integer
                          external_account_id:
                            format: int64
                            kind: integer
                          account_name:
                            kind: string
                          membership_id:
                            format: uuid
                            kind: string
                            instance: 00000000-0000-0000-0000-000000000000
                  description: Details about a person.
                description: A listing of customers.
              paging:
                  kind: object
                  properties:
                    result_set_size:
                      format: int32
                      kind: integer
                      description: The variety of objects in a outcome set (web page).
                    result_set_start_position:
                      format: int32
                      kind: integer
                      description: The index place of the primary outcome on this set.
                    result_set_end_position:
                      format: int32
                      kind: integer
                      description: The index place of the final outcome on this set.
                    total_set_size:
                      format: int32
                      kind: integer
                      description: The full variety of outcomes.
                    subsequent:
                      kind: string
                      description: 'A URL to the following set of outcomes. '
                    earlier:
                      kind: string
                      description: 'A URL to the earlier set of outcomes. '
                  description: Comprises details about paging by way of the outcomes.
            description: A response containing details about customers.

Tags: AmazonAnthropicsautomaticallyBedrockClaudecodeconnectorsgenerateSaaSSailPointTypeScript
Previous Post

High-quality-Tuning BERT for Textual content Classification | by Shaw Talebi | Oct, 2024

Next Post

Reinforcement Studying for Physics: ODEs and Hyperparameter Tuning | by Robert Etter | Oct, 2024

Next Post
Reinforcement Studying for Physics: ODEs and Hyperparameter Tuning | by Robert Etter | Oct, 2024

Reinforcement Studying for Physics: ODEs and Hyperparameter Tuning | by Robert Etter | Oct, 2024

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Popular News

  • How Aviva constructed a scalable, safe, and dependable MLOps platform utilizing Amazon SageMaker

    How Aviva constructed a scalable, safe, and dependable MLOps platform utilizing Amazon SageMaker

    401 shares
    Share 160 Tweet 100
  • Diffusion Mannequin from Scratch in Pytorch | by Nicholas DiSalvo | Jul, 2024

    401 shares
    Share 160 Tweet 100
  • Unlocking Japanese LLMs with AWS Trainium: Innovators Showcase from the AWS LLM Growth Assist Program

    401 shares
    Share 160 Tweet 100
  • Proton launches ‘Privacy-First’ AI Email Assistant to Compete with Google and Microsoft

    401 shares
    Share 160 Tweet 100
  • Streamlit fairly styled dataframes half 1: utilizing the pandas Styler

    400 shares
    Share 160 Tweet 100

About Us

Automation Scribe is your go-to site for easy-to-understand Artificial Intelligence (AI) articles. Discover insights on AI tools, AI Scribe, and more. Stay updated with the latest advancements in AI technology. Dive into the world of automation with simplified explanations and informative content. Visit us today!

Category

  • AI Scribe
  • AI Tools
  • Artificial Intelligence

Recent Posts

  • Multi-account help for Amazon SageMaker HyperPod activity governance
  • How I Automated My Machine Studying Workflow with Simply 10 Strains of Python
  • Implement semantic video search utilizing open supply giant imaginative and prescient fashions on Amazon SageMaker and Amazon OpenSearch Serverless
  • Home
  • Contact Us
  • Disclaimer
  • Privacy Policy
  • Terms & Conditions

© 2024 automationscribe.com. All rights reserved.

No Result
View All Result
  • Home
  • AI Scribe
  • AI Tools
  • Artificial Intelligence
  • Contact Us

© 2024 automationscribe.com. All rights reserved.