Group Abstract Group Abstract

Message Boards Message Boards

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

Posted 5 months ago

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

Attachments:
POSTED BY: Kirill Belov
17 Replies
Posted 11 days ago

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

POSTED BY: Kirill Belov
Posted 12 days ago

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

POSTED BY: Mma Usr
Posted 12 days ago

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.

POSTED BY: Mma Usr

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://community.wolfram.com/groups/-/m/t/3300846";
AIChatComplete[chat, "Summarize this post and give the mission statement of the dicussed paclet: " <> url];
chat[-1]["content"]
>> URLRead call:  https://community.wolfram.com/groups/-/m/t/3300846

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.

Attachments:
POSTED BY: Anton Antonov
Posted 13 days ago

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.

POSTED BY: Kirill Belov
Posted 13 days ago

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.

POSTED BY: Alan Mok
Posted 13 days ago

Is DeepSeek support plugins?

POSTED BY: Kirill Belov
Posted 13 days ago

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

POSTED BY: Alan Mok
Posted 13 days ago

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

POSTED BY: Kirill Belov
Posted 13 days ago

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

POSTED BY: Kirill Belov
Posted 13 days ago

enter image description here

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

POSTED BY: Kirill Belov
Posted 13 days ago

Hi,

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

Thanks

Alan

POSTED BY: Alan Mok
Posted 14 days ago
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?

POSTED BY: Kirill Belov
Posted 14 days ago

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?

POSTED BY: Updating Name
Posted 14 days ago

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

POSTED BY: Kirill Belov
Posted 14 days ago

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.

POSTED BY: Mma Usr

enter image description here -- you have earned Featured Contributor Badge enter image description here 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!

POSTED BY: EDITORIAL BOARD
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard