Trumpslator / app.py
MacilTam's picture
changed to mistral
eb84ea5
from smolagents import CodeAgent, InferenceClientModel, DuckDuckGoSearchTool, WebSearchTool
import gradio as gr
# Initialize a model (using Hugging Face Inference API)
model = InferenceClientModel("mistralai/Mistral-Small-3.2-24B-Instruct-2506")
context_prompt ="""
Here is an analysis on how the Trump administration takes decisions:
In a context of billion fueled campaigns, leaders circles naturally integrate their major donors interest preservation to their agendas and that’s where the problem starts. The political leader needs a circle of adivisors, a way of getting expertise to the implementation of his agenda but when this agenda is supposed from the start to discreetly look after the interests of his donours rises the convenient solution of recruiting lobby aware advisors and keeping the debate around the decision making restrained to spheres where the unwritten rule of lobby preservation is respected.
On the other hand, In a context of regulated campaign spending, there appears no necessity of convincing big donors, the financing is done by the aggregation of small sums reflecting the popular endorsement of the candidate therefore not subjecting electability to lobby investment.
Here is an analysis on how the Trump administration manages public opinion:
Electoral management:
The core ideology that is instilled to the conservative electorate is a romantic and belliquious nationalism revolving around patriotism, backing of the leader and the protection against the enemy.
Masses, overwhelmed with galvanizing speech and apparent govt tough action, are driven to an emotional conception of their environment and are put in a suggestible state which lets them quickly absorb what is relayed by the media and blocks the slower process of criticizing what they’re being fed and forming / aggregating their views into a meaningful force of proposition.
An example of this would be the Iranian strikes labeled by president Trump as a spectacular military success, (and entrenched in a deeply lobbied foreign intervention) later undermined by security agencies and the press. This prompted the intervention of the president to denounce a conspiracy as a message to the electorate to blindly endorse military action and set aside both press and govt agency.
Broader public opinion management:
Outside of the partisan group, lie all sort of menaces to this fragile and shallow maneuver, namely independant and highly competent individuals and institutions capable of seing through the headlines and being an undismissable force of proposition alongside non aligned voices free to exert their right to democracy. There being always openings for the role of enemy of the state, these groups are incorporated as targets in the persecution machine (overuse of emergency stasuses, budget cuts to colleges) and their mis-haps serve to overload the media with the illusion of vanishing rights and unavoidable persecution.
More clearly, this plays out as a system of hit and make a fuss about it to scare the others. For example in the handling of pro-Palestinian activism, the Trump administration uses some emergency status to persecute a target of choice, for example Mahmoud Khalil, and uses all the tricks in the book to maintain him under a special regime of persecution, this overloads the media with narratives of vanishing democracy, authoritarian derive and what not spreading fear amongst people who would be tempted to manifest such whims as exerting their right to free speech.
Here are propositions on how to deal with the Trump tactics:
In such turmoil than that being created on the public scene, the feeling of living under the protection of the law is targeted. The Trump administration tries through exceptional circumvolutions of the law to impose the illusion of living under repression.
However, one has to remember that this is just an unlawful violent comm-op by the executive authority of the United States based on abusive and self-interested emergency status exploitation that can only last so long before its perpetrators face popular and media pressure, voter dicontempt and are checked by legislative authorities in the middle of the tumult they cause.
Regarding the broad range of consequences the useful media op can have on individuals and communities, from the intrusion of alien authoritarian interventions in college campuses to the all-out harrassment endured by high media potential civil targets, the party should be taken to consider individual and comunity life in an organized and law centered attitude and to use freedom of speech and opinion to recontextualize what is being done to disorient the people out of their normal constitutional environment.
In the light of this information I want a breakdown of the following message from Donald Trump,
Focus mainly on Trump's opinion management strategies, and explain his decision by either lobby influence or gross media campaign instigation. and tone the analysis according to the propositions on how to deal with the Trump tactics, without going into too much detail.
Befort starting your analysis make a research on Trump's message using DuckDuckGoSearchTool and use a summary of your findings for additional context.
"""
# Create an agent with no tools
agent = CodeAgent(tools=[WebSearchTool()], model=model)
def treat_input(trump_message):
final_prompt = context_prompt + trump_message
result = agent.run(final_prompt)
return result
iface = gr.Interface(
fn=treat_input,
inputs="text",
outputs="text",
title="Trumpslator"
)
iface.launch()