BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
smackerz1988
Pyrite | Level 9

Hello,

 

I'm working on a sas macro that calls in ChatGPT into a SAS enviroment. I'm using this code whcih works successfully

 

 data _null_;
    file in;
    put "{";
    put '"model": "gpt-3.5-turbo", "messages": [{"role": "user", "content"'}']'; 
    put "}";
    run;
 /* Reference that file as IN= parm in PROC HTTP POST */
    filename resp "%sysfunc(getoption(WORK))/echo.json";

    /* Send the request and payload */
    proc http 
        method = "POST"
        url    = "https://api.openai.com/v1/chat/completions"
        ct     = "application/json"
        in     = in
        out    = resp;
        headers "Authorization" = "Bearer &api_key.";
    run;    

 

My question is how do I alter this so I can explore some of the beta plug-ins that were introduced?. I do have a chatgpt 4 subscription so this is not an issue. is it better to create a separate macro for plug in specific requests as it would be a separate url or can it be altered within a single macro call?

1 ACCEPTED SOLUTION

Accepted Solutions
rudfaden
Pyrite | Level 9

No. Proc http can get data from websites

 

View solution in original post

3 REPLIES 3
rudfaden
Pyrite | Level 9
Which parameter do you want to change?
smackerz1988
Pyrite | Level 9

I guess what I'm trying to ascertain is can PROC HTTP be used to bring in plug ins associated with applications such as ChatGPT? Such as PDF Reader?

rudfaden
Pyrite | Level 9

No. Proc http can get data from websites

 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 536 views
  • 0 likes
  • 2 in conversation