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

 

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 594 views
  • 0 likes
  • 2 in conversation