AILink paclet: Wolfram + GPT-4o integration with plugins, web and system access, and data analysis

DOWNLOAD-DESKTOP-NOTEBOOK.nb (106 KB)

11 Likes

news-congrads-kkluyshnik-02-04-19.jpg – you have earned Featured Contributor Badge 2015-11-02_10-07-11.png
Your exceptional post has been selected for our editorial column Staff Picks http://wolfr.am/StaffPicks and Your Profile is now distinguished by a Featured Contributor Badge and is displayed on the Featured Contributor Board. Thank you!

1 Like

How difficult would it be to refactor your paclet so that it could be used with any LLM that is compatible with the OpenAI API?

If so, I think it would be useful to a lot of people right now.

1 Like

I made the paclet that way from the beginning. That is, I did not make the package specifically for ChatGPT, but made it possible to use it with any API, which is made compatible with OpenAI API. For example, I ran ollama + llama model locally and my package interacted with that model without any additional actions. Do you have a specific purpose where you want to use it? I could try it and tell you if it is compatible now

1 Like

After browsing through the code on github, it appears that the openai.com domain is hardcoded several times in the file AILink.wl.

Are you changing that domain manually when you want to run an LLM from a different provider?

1 Like

chat = AIChatObject[“Endpoint” → “https://not-open-ai/api/chat/complete”]

You can use another endpoint like above. Can you exaplene some more concrete example what do you want to do?

2 Likes

Hi,

Suppose I want to use Deepseek as end point . What should be the change if any ?

Thanks

Alan

1 Like

PacletInstall["KirillBelov/Objects"]; 
PacletInstall["KirillBelov/Internal"]; 
PacletInstall["KirillBelov/AILink"]; 

Get["KirillBelov`AILink`ChatCompletions`"]; 

chat = AIChatObject[
   "APIKey" -> SystemCredential["DEEPSEEK_API_KEY"], 
   "Endpoint" -> "https://api.deepseek.com/chat/completions", 
   "Model" -> "deepseek-chat"
   ]; 

chat["Messages"] += "Hello, are you DeepSeek model?"; 

AIChatComplete[chat]

chat["Messages"]

In the screenshot, DeepSeek is telling me that I don’t have the money to get the competion. If I could pay for tokens, he might have replied something.

Note the dependencies. The Internal package requires some compiled C libraries, I only compiled them for myself - I have Windows 11 x64 and Wolfram Languabe 14.2

1 Like

Please ask any other questions and ask if you are having trouble with anything else
I also realized I wasn’t processing the balance error, since I hadn’t had one until now

1 Like

I thought about it and realized it was worth making examples of popular models being used to make it easier for users. Thank you for your question - you gave me this idea

1 Like

Hi,
After modifying the code, I can work with Deepseek The duckDuckGoSearch is workoing. But for the last part whereby I need to search for Donald Trump interview, I got no result.

Regards

Alan

1 Like

Is DeepSeek support plugins?

Hi,
I am not sure whether Deepseek is supporting plugins. But this may be the reason why I am not getting result on the last part. Any way, thanks for your answer.

1 Like

Even though the API is compatible with OpenAI, it doesn’t mean that the same functions are supported there. If plugins are not supported, there is no point in adding them.

1 Like

As an example of “eat your own dog food” let’s derive the mission statement for “KirillBelov/AILink”.


(The setup is the same as in the post.)

chat = AIChatObject["You are assistant", "Temperature" -> 0.6, "Model" -> "gpt-4o", "Tools" -> {}]
chat["Tools"] = {time, urlRead, duckDuckGoSearch};
url = " https://wolfram.discourse.group/t/24676/1 ";
AIChatComplete[chat, "Summarize this post and give the mission statement of the dicussed paclet: " <> url];
chat[-1]["content"]
>> URLRead call:  https://wolfram.discourse.group/t/24676/1

The post discusses the “AILink paclet,” which integrates Wolfram with
GPT-4o, providing plugins, web and system access, and data analysis
capabilities. The conversation involves users exploring how to modify
the paclet to work with different endpoints like DeepSeek and
discusses the compatibility of APIs with OpenAI. The paclet is
designed to be versatile, allowing use with any API compatible with
OpenAI’s API, not just ChatGPT.

Mission Statement of AILink Paclet:
The AILink paclet aims to integrate Wolfram technologies with
advanced language models like GPT-4o, offering enhanced
functionalities such as plugin support, web and system access, and
data analysis, while maintaining compatibility with various APIs,
thereby broadening its usability and application scope.

Summarizing-AILink-post.nb (37.2 KB)

2 Likes

I want to explore LLM-generated GraphRAG.

My hope is that your more generic LLM framework will make this easier to do from within Mathematica.

1 Like

Wonder if Mathematica will eventually become an MCP client as the industry starts to standardize around this protocol for tool calling.

1 Like

Thanks for sharing! Maybe I try to implement MCP Client and Server for WL =)
I have to learn about this technology more

1 Like