- ਫੰਕਸ਼ਨ ਕਾਲਿੰਗ ਕੀ ਹੈ?
- ਫੰਕਸ਼ਨ ਕਾਲਿੰਗ ਕਿਵੇਂ ਕੰਮ ਕਰਦੀ ਹੈ
- ਐਪਲੀਕੇਸ਼ਨ ਸਥਿਤੀਆਂ
- Phi-4-mini ਅਤੇ Ollama ਨਾਲ ਫੰਕਸ਼ਨ ਕਾਲਿੰਗ ਸੈਟਅਪ ਕਰਨਾ
- Qwen3 ਫੰਕਸ਼ਨ ਕਾਲਿੰਗ ਨਾਲ ਕੰਮ ਕਰਨਾ
- Foundry Local ਇੰਟੀਗ੍ਰੇਸ਼ਨ
- ਸਰਵੋਤਮ ਅਭਿਆਸ ਅਤੇ ਟਰਬਲਸ਼ੂਟਿੰਗ
- ਉੱਚ-ਪੱਧਰੀ ਉਦਾਹਰਨਾਂ
ਫੰਕਸ਼ਨ ਕਾਲਿੰਗ ਇੱਕ ਸ਼ਕਤੀਸ਼ਾਲੀ ਸਮਰੱਥਾ ਹੈ ਜੋ ਛੋਟੇ ਭਾਸ਼ਾ ਮਾਡਲ (SLMs) ਨੂੰ ਬਾਹਰੀ ਟੂਲ, APIs, ਅਤੇ ਸੇਵਾਵਾਂ ਨਾਲ ਸੰਚਾਰ ਕਰਨ ਦੀ ਆਗਿਆ ਦਿੰਦੀ ਹੈ। ਇਹ ਸਮਰੱਥਾ SLMs ਨੂੰ ਸਿਰਫ਼ ਸਿਖਲਾਈ ਡਾਟਾ ਤੱਕ ਸੀਮਿਤ ਹੋਣ ਦੀ ਬਜਾਏ:
- ਬਾਹਰੀ APIs ਨਾਲ ਜੁੜਨਾ (ਮੌਸਮ ਸੇਵਾਵਾਂ, ਡਾਟਾਬੇਸ, ਖੋਜ ਇੰਜਨ)
- ਵਰਤੋਂਕਾਰ ਦੀ ਮੰਗ ਅਨੁਸਾਰ ਵਿਸ਼ੇਸ਼ ਫੰਕਸ਼ਨ ਚਲਾਉਣਾ
- ਵੱਖ-ਵੱਖ ਸਰੋਤਾਂ ਤੋਂ ਰੀਅਲ-ਟਾਈਮ ਜਾਣਕਾਰੀ ਪ੍ਰਾਪਤ ਕਰਨਾ
- ਵਿਸ਼ੇਸ਼ ਟੂਲਾਂ ਰਾਹੀਂ ਗਣਨਾਤਮਕ ਕੰਮ ਕਰਨਾ
- ਜਟਿਲ ਵਰਕਫਲੋਜ਼ ਲਈ ਕਈ ਕਾਰਵਾਈਆਂ ਨੂੰ ਜੋੜਨਾ
ਇਹ ਸਮਰੱਥਾ SLMs ਨੂੰ ਸਥਿਰ ਟੈਕਸਟ ਜਨਰੇਟਰ ਤੋਂ ਡਾਇਨਾਮਿਕ AI ਏਜੰਟਾਂ ਵਿੱਚ ਬਦਲ ਦਿੰਦੀ ਹੈ ਜੋ ਅਸਲ-ਜਗਤ ਦੇ ਕੰਮ ਕਰ ਸਕਦੇ ਹਨ।
ਫੰਕਸ਼ਨ ਕਾਲਿੰਗ ਦੀ ਪ੍ਰਕਿਰਿਆ ਇੱਕ ਵਿਵਸਥਿਤ ਵਰਕਫਲੋ ਦੀ ਪਾਲਣਾ ਕਰਦੀ ਹੈ:
- ਬਾਹਰੀ ਟੂਲ: SLMs ਮੌਸਮ APIs, ਡਾਟਾਬੇਸ, ਵੈੱਬ ਸੇਵਾਵਾਂ, ਅਤੇ ਹੋਰ ਬਾਹਰੀ ਸਿਸਟਮਾਂ ਨਾਲ ਜੁੜ ਸਕਦੇ ਹਨ
- ਫੰਕਸ਼ਨ ਪਰਿਭਾਸ਼ਾਵਾਂ: ਹਰ ਟੂਲ ਨੂੰ ਵਿਸ਼ੇਸ਼ ਪੈਰਾਮੀਟਰ, ਇਨਪੁਟ/ਆਉਟਪੁੱਟ ਫਾਰਮੈਟ, ਅਤੇ ਵੇਰਵੇ ਨਾਲ ਪਰਿਭਾਸ਼ਿਤ ਕੀਤਾ ਜਾਂਦਾ ਹੈ
- API ਅਨੁਕੂਲਤਾ: ਟੂਲਾਂ ਨੂੰ ਮਿਆਰੀ ਇੰਟਰਫੇਸਾਂ (REST APIs, SDKs, ਆਦਿ) ਰਾਹੀਂ ਜੋੜਿਆ ਜਾਂਦਾ ਹੈ
ਫੰਕਸ਼ਨ ਤਿੰਨ ਮੁੱਖ ਹਿੱਸਿਆਂ ਨਾਲ ਪਰਿਭਾਸ਼ਿਤ ਕੀਤੇ ਜਾਂਦੇ ਹਨ:
{
"name": "function_name",
"description": "Clear description of what the function does",
"parameters": {
"parameter_name": {
"description": "What this parameter represents",
"type": "data_type",
"default": "default_value"
}
}
}- ਨੈਚਰਲ ਲੈਂਗਵੇਜ ਪ੍ਰੋਸੈਸਿੰਗ: SLM ਵਰਤੋਂਕਾਰ ਦੀ ਇਨਪੁੱਟ ਦਾ ਵਿਸ਼ਲੇਸ਼ਣ ਕਰਦਾ ਹੈ ਤਾਂ ਜੋ ਇਰਾਦਾ ਸਮਝਿਆ ਜਾ ਸਕੇ
- ਫੰਕਸ਼ਨ ਮੈਚਿੰਗ: ਇਹ ਨਿਰਧਾਰਤ ਕਰਦਾ ਹੈ ਕਿ ਵਰਤੋਂਕਾਰ ਦੀ ਮੰਗ ਪੂਰੀ ਕਰਨ ਲਈ ਕਿਹੜੇ ਫੰਕਸ਼ਨ ਦੀ ਲੋੜ ਹੈ
- ਪੈਰਾਮੀਟਰ ਨਿਕਾਲ: ਵਰਤੋਂਕਾਰ ਦੇ ਸੁਨੇਹੇ ਤੋਂ ਲੋੜੀਂਦੇ ਪੈਰਾਮੀਟਰਾਂ ਦੀ ਪਛਾਣ ਅਤੇ ਨਿਕਾਸ ਕਰਦਾ ਹੈ
SLM ਸੰਰਚਿਤ JSON ਤਿਆਰ ਕਰਦਾ ਹੈ ਜਿਸ ਵਿੱਚ:
- ਕਾਲ ਕਰਨ ਲਈ ਫੰਕਸ਼ਨ ਦਾ ਨਾਮ
- ਲੋੜੀਂਦੇ ਪੈਰਾਮੀਟਰਾਂ ਦੇ ਸਹੀ ਮੁੱਲਾਂ ਨਾਲ
- ਐਗਜ਼ਿਕਿਊਸ਼ਨ ਸੰਦਰਭ ਅਤੇ ਮੈਟਾਡੇਟਾ
- ਪੈਰਾਮੀਟਰ ਵੈਰੀਫਿਕੇਸ਼ਨ: ਯਕੀਨੀ ਬਣਾਉਂਦਾ ਹੈ ਕਿ ਸਾਰੇ ਲੋੜੀਂਦੇ ਪੈਰਾਮੀਟਰ ਮੌਜੂਦ ਹਨ ਅਤੇ ਸਹੀ ਫਾਰਮੈਟ ਵਿੱਚ ਹਨ
- ਫੰਕਸ਼ਨ ਐਗਜ਼ਿਕਿਊਸ਼ਨ: ਐਪਲੀਕੇਸ਼ਨ ਦਿੱਤੇ ਪੈਰਾਮੀਟਰਾਂ ਨਾਲ ਨਿਰਧਾਰਤ ਫੰਕਸ਼ਨ ਚਲਾਉਂਦੀ ਹੈ
- ਗਲਤੀ ਸੰਭਾਲ: ਫੇਲ੍ਹ, ਟਾਈਮਆਉਟ, ਅਤੇ ਗਲਤ ਜਵਾਬਾਂ ਨੂੰ ਸੰਭਾਲਦਾ ਹੈ
- ਨਤੀਜਾ ਪ੍ਰੋਸੈਸਿੰਗ: ਫੰਕਸ਼ਨ ਆਉਟਪੁੱਟ ਨੂੰ SLM ਨੂੰ ਵਾਪਸ ਕੀਤਾ ਜਾਂਦਾ ਹੈ
- ਸੰਦਰਭ ਇੰਟੀਗ੍ਰੇਸ਼ਨ: SLM ਨਤੀਜਿਆਂ ਨੂੰ ਆਪਣੇ ਜਵਾਬ ਵਿੱਚ ਸ਼ਾਮਲ ਕਰਦਾ ਹੈ
- ਵਰਤੋਂਕਾਰ ਸੰਚਾਰ: ਜਾਣਕਾਰੀ ਨੂੰ ਕੁਦਰਤੀ, ਗੱਲਬਾਤੀ ਫਾਰਮੈਟ ਵਿੱਚ ਪੇਸ਼ ਕਰਦਾ ਹੈ
ਕੁਦਰਤੀ ਭਾਸ਼ਾ ਪੁੱਛਗਿੱਛ ਨੂੰ ਸੰਰਚਿਤ API ਕਾਲਾਂ ਵਿੱਚ ਬਦਲੋ:
- "ਮੇਰੇ ਹਾਲੀਆ ਆਰਡਰ ਦਿਖਾਓ" → ਵਰਤੋਂਕਾਰ ID ਅਤੇ ਮਿਤੀ ਫਿਲਟਰਾਂ ਨਾਲ ਡਾਟਾਬੇਸ ਪੁੱਛਗਿੱਛ
- "ਟੋਕੀਓ ਵਿੱਚ ਮੌਸਮ ਕਿਵੇਂ ਹੈ?" → ਸਥਾਨ ਪੈਰਾਮੀਟਰ ਨਾਲ ਮੌਸਮ API ਕਾਲ
- "ਪਿਛਲੇ ਹਫ਼ਤੇ ਜੌਨ ਤੋਂ ਆਈ ਈਮੇਲਾਂ ਲੱਭੋ" → ਭੇਜਣ ਵਾਲੇ ਅਤੇ ਮਿਤੀ ਫਿਲਟਰਾਂ ਨਾਲ ਈਮੇਲ ਸੇਵਾ ਪੁੱਛਗਿੱਛ
ਵਰਤੋਂਕਾਰ ਦੀ ਮੰਗ ਨੂੰ ਵਿਸ਼ੇਸ਼ ਫੰਕਸ਼ਨ ਕਾਲਾਂ ਵਿੱਚ ਬਦਲੋ:
- "ਕੱਲ੍ਹ 2 ਵਜੇ ਲਈ ਮੀਟਿੰਗ ਸ਼ਡਿਊਲ ਕਰੋ" → ਕੈਲੰਡਰ API ਇੰਟੀਗ੍ਰੇਸ਼ਨ
- "ਟੀਮ ਨੂੰ ਸੁਨੇਹਾ ਭੇਜੋ" → ਸੰਚਾਰ ਪਲੇਟਫਾਰਮ API
- "ਮੇਰੀ ਫਾਈਲਾਂ ਦਾ ਬੈਕਅਪ ਬਣਾਓ" → ਫਾਈਲ ਸਿਸਟਮ ਕਾਰਵਾਈ
ਜਟਿਲ ਗਣਿਤਕ ਜਾਂ ਤਰਕਸ਼ੀਲ ਕਾਰਵਾਈਆਂ ਸੰਭਾਲੋ:
- "$10,000 'ਤੇ 5% ਦਰ 'ਤੇ 10 ਸਾਲਾਂ ਲਈ ਚੱਕਰਵਾਦੀ ਵਿਆਜ ਦੀ ਗਣਨਾ ਕਰੋ" → ਵਿੱਤੀ ਗਣਨਾ ਫੰਕਸ਼ਨ
- "ਇਸ ਡਾਟਾਸੈਟ ਦਾ ਰੁਝਾਨਾਂ ਲਈ ਵਿਸ਼ਲੇਸ਼ਣ ਕਰੋ" → ਅੰਕੜਾ ਵਿਸ਼ਲੇਸ਼ਣ ਟੂਲ
- "ਡਿਲਿਵਰੀ ਲਈ ਇਸ ਰੂਟ ਨੂੰ ਅਨੁਕੂਲ ਬਣਾਓ" → ਰੂਟ ਅਨੁਕੂਲਤਾ ਐਲਗੋਰਿਥਮ
ਜਟਿਲ ਕਾਰਵਾਈਆਂ ਲਈ ਕਈ ਫੰਕਸ਼ਨ ਕਾਲਾਂ ਨੂੰ ਜੋੜੋ:
- ਕਈ ਸਰੋਤਾਂ ਤੋਂ ਡਾਟਾ ਪ੍ਰਾਪਤ ਕਰੋ
- ਜਾਣਕਾਰੀ ਨੂੰ ਪਾਰਸ ਅਤੇ ਵੈਰੀਫਾਈ ਕਰੋ
- ਡਾਟਾ ਨੂੰ ਲੋੜੀਂਦੇ ਫਾਰਮੈਟ ਵਿੱਚ ਬਦਲੋ
- ਨਤੀਜੇ ਨੂੰ ਸਹੀ ਸਿਸਟਮਾਂ ਵਿੱਚ ਸਟੋਰ ਕਰੋ
- ਰਿਪੋਰਟਾਂ ਜਾਂ ਵਿਜ਼ੁਅਲਾਈਜ਼ੇਸ਼ਨ ਤਿਆਰ ਕਰੋ
ਡਾਇਨਾਮਿਕ ਇੰਟਰਫੇਸ ਅਪਡੇਟ ਨੂੰ ਯਕੀਨੀ ਬਣਾਓ:
- "ਡੈਸ਼ਬੋਰਡ 'ਤੇ ਵਿਕਰੀ ਡਾਟਾ ਦਿਖਾਓ" → ਚਾਰਟ ਜਨਰੇਸ਼ਨ ਅਤੇ ਡਿਸਪਲੇਅ
- "ਨਵੇਂ ਸਥਾਨਾਂ ਨਾਲ ਨਕਸ਼ਾ ਅਪਡੇਟ ਕਰੋ" → ਜਿਓਸਪੇਸ਼ਲ ਡਾਟਾ ਇੰਟੀਗ੍ਰੇਸ਼ਨ
- "ਇਨਵੈਂਟਰੀ ਡਿਸਪਲੇਅ ਨੂੰ ਰੀਫ੍ਰੈਸ਼ ਕਰੋ" → ਰੀਅਲ-ਟਾਈਮ ਡਾਟਾ ਸਿੰਕ੍ਰੋਨਾਈਜ਼ੇਸ਼ਨ
Microsoft ਦਾ Phi-4-mini Ollama ਰਾਹੀਂ ਇੱਕਲ ਅਤੇ ਸਮਾਂਤਰ ਫੰਕਸ਼ਨ ਕਾਲਿੰਗ ਦੋਵੇਂ ਦਾ ਸਮਰਥਨ ਕਰਦਾ ਹੈ। ਇਸ ਨੂੰ ਸੈਟਅਪ ਕਰਨ ਦਾ ਤਰੀਕਾ ਇਹ ਹੈ:
- Ollama ਵਰਜਨ 0.5.13 ਜਾਂ ਇਸ ਤੋਂ ਉੱਚਾ
- Phi-4-mini ਮਾਡਲ (ਸੁਝਾਏ ਗਏ:
phi4-mini:3.8b-fp16)
# Download the model (if not already present)
ollama run phi4-mini:3.8b-fp16
# Verify the model is available
ollama listOllama ਦੇ ਮੌਜੂਦਾ ਟੈਂਪਲੇਟਾਂ ਵਿੱਚ ਸੀਮਾਵਾਂ ਦੇ ਕਾਰਨ, ਤੁਹਾਨੂੰ ਹੇਠਾਂ ਦਿੱਤੇ ਟੈਂਪਲੇਟ ਨਾਲ ਇੱਕ ਕਸਟਮ ModelFile ਬਣਾਉਣ ਦੀ ਲੋੜ ਹੈ:
TEMPLATE """
{{- if .Messages }}
{{- if or .System .Tools }}<|system|>
{{ if .System }}{{ .System }}
{{- end }}
In addition to plain text responses, you can chose to call one or more of the provided functions.
Use the following rule to decide when to call a function:
* if the response can be generated from your internal knowledge (e.g., as in the case of queries like "What is the capital of Poland?"), do so
* if you need external information that can be obtained by calling one or more of the provided functions, generate a function calls
If you decide to call functions:
* prefix function calls with functools marker (no closing marker required)
* all function calls should be generated in a single JSON list formatted as functools[{"name": [function name], "arguments": [function arguments as JSON]}, ...]
* follow the provided JSON schema. Do not hallucinate arguments or values. Do to blindly copy values from the provided samples
* respect the argument type formatting. E.g., if the type if number and format is float, write value 7 as 7.0
* make sure you pick the right functions that match the user intent
Available functions as JSON spec:
{{- if .Tools }}
{{ .Tools }}
{{- end }}<|end|>
{{- end }}
{{- range .Messages }}
{{- if ne .Role "system" }}<|{{ .Role }}|>
{{- if and .Content (eq .Role "tools") }}
{"result": {{ .Content }}}
{{- else if .Content }}
{{ .Content }}
{{- else if .ToolCalls }}
functools[
{{- range .ToolCalls }}{{ "{" }}"name": "{{ .Function.Name }}", "arguments": {{ .Function.Arguments }}{{ "}" }}
{{- end }}]
{{- end }}<|end|>
{{- end }}
{{- end }}<|assistant|>
{{ else }}
{{- if .System }}<|system|>
{{ .System }}<|end|>{{ end }}{{ if .Prompt }}<|user|>
{{ .Prompt }}<|end|>{{ end }}<|assistant|>
{{ end }}{{ .Response }}{{ if .Response }}<|user|>{{ end }}
"""
# Save the template above as 'Modelfile' and run:
ollama create phi4-mini-fc:3.8b-fp16 -f ./Modelfileimport json
import requests
# Define the tool/function
tools = [
{
"name": "get_weather",
"description": "Get current weather information for a location",
"parameters": {
"location": {
"description": "The city or location name",
"type": "str",
"default": "New York"
},
"units": {
"description": "Temperature units (celsius or fahrenheit)",
"type": "str",
"default": "celsius"
}
}
}
]
# Create the message with system prompt including tools
messages = [
{
"role": "system",
"content": "You are a helpful weather assistant",
"tools": json.dumps(tools)
},
{
"role": "user",
"content": "What's the weather like in London today?"
}
]
# Make request to Ollama API
response = requests.post(
"http://localhost:11434/api/chat",
json={
"model": "phi4-mini-fc:3.8b-fp16",
"messages": messages,
"stream": False
}
)
print(response.json())import json
import requests
# Define multiple tools for parallel execution
AGENT_TOOLS = {
"booking_flight": {
"name": "booking_flight",
"description": "Book a flight ticket",
"parameters": {
"departure": {
"description": "Departure airport code",
"type": "str"
},
"destination": {
"description": "Destination airport code",
"type": "str"
},
"outbound_date": {
"description": "Departure date (YYYY-MM-DD)",
"type": "str"
},
"return_date": {
"description": "Return date (YYYY-MM-DD)",
"type": "str"
}
}
},
"booking_hotel": {
"name": "booking_hotel",
"description": "Book a hotel room",
"parameters": {
"city": {
"description": "City name for hotel booking",
"type": "str"
},
"check_in_date": {
"description": "Check-in date (YYYY-MM-DD)",
"type": "str"
},
"check_out_date": {
"description": "Check-out date (YYYY-MM-DD)",
"type": "str"
}
}
}
}
SYSTEM_PROMPT = """
You are my travel agent with some tools available.
"""
messages = [
{
"role": "system",
"content": SYSTEM_PROMPT,
"tools": json.dumps(AGENT_TOOLS)
},
{
"role": "user",
"content": "I need to travel from London to New York from March 21 2025 to March 27 2025. Please book both flight and hotel."
}
]
# The model will generate parallel function calls
response = requests.post(
"http://localhost:11434/api/chat",
json={
"model": "phi4-mini-fc:3.8b-fp16",
"messages": messages,
"stream": False
}
)
print(response.json())Qwen3 ਉੱਚ-ਪੱਧਰੀ ਫੰਕਸ਼ਨ ਕਾਲਿੰਗ ਸਮਰੱਥਾ ਪ੍ਰਦਾਨ ਕਰਦਾ ਹੈ ਜਿਸ ਵਿੱਚ ਸ਼ਾਨਦਾਰ ਪ੍ਰਦਰਸ਼ਨ ਅਤੇ ਲਚਕਤਾ ਹੈ। ਇਸ ਨੂੰ ਲਾਗੂ ਕਰਨ ਦਾ ਤਰੀਕਾ ਇਹ ਹੈ:
Qwen-Agent ਇੱਕ ਉੱਚ-ਪੱਧਰੀ ਫਰੇਮਵਰਕ ਪ੍ਰਦਾਨ ਕਰਦਾ ਹੈ ਜੋ ਫੰਕਸ਼ਨ ਕਾਲਿੰਗ ਲਾਗੂ ਕਰਨ ਨੂੰ ਸਧਾਰਨ ਬਣਾਉਂਦਾ ਹੈ:
pip install -U "qwen-agent[gui,rag,code_interpreter,mcp]"import os
from qwen_agent.agents import Assistant
# Configure the LLM
llm_cfg = {
'model': 'Qwen3-8B',
# Option 1: Use Alibaba Model Studio
'model_type': 'qwen_dashscope',
'api_key': os.getenv('DASHSCOPE_API_KEY'),
# Option 2: Use local deployment
# 'model_server': 'http://localhost:8000/v1',
# 'api_key': 'EMPTY',
# Optional configuration for thinking mode
'generate_cfg': {
'thought_in_content': True, # Include reasoning in response
}
}
# Define tools using MCP (Model Context Protocol)
tools = [
{
'mcpServers': {
'time': {
'command': 'uvx',
'args': ['mcp-server-time', '--local-timezone=Asia/Shanghai']
},
'fetch': {
'command': 'uvx',
'args': ['mcp-server-fetch']
}
}
},
'code_interpreter', # Built-in code execution tool
]
# Create the assistant
bot = Assistant(llm=llm_cfg, function_list=tools)
# Example usage
messages = [
{
'role': 'user',
'content': 'What time is it now? Also, fetch the latest news from https://example.com/news'
}
]
# Generate response with function calling
for response in bot.run(messages=messages):
print(response)ਤੁਸੀਂ Qwen3 ਲਈ ਕਸਟਮ ਫੰਕਸ਼ਨ ਵੀ ਪਰਿਭਾਸ਼ਿਤ ਕਰ ਸਕਦੇ ਹੋ:
import json
from qwen_agent.tools.base import BaseTool
class WeatherTool(BaseTool):
description = 'Get weather information for a specific location'
parameters = [
{
'name': 'location',
'type': 'string',
'description': 'City or location name',
'required': True
},
{
'name': 'units',
'type': 'string',
'description': 'Temperature units (celsius or fahrenheit)',
'required': False,
'default': 'celsius'
}
]
def call(self, params: str, **kwargs) -> str:
"""Execute the weather lookup"""
params_dict = json.loads(params)
location = params_dict.get('location')
units = params_dict.get('units', 'celsius')
# Simulate weather API call
weather_data = {
'location': location,
'temperature': '22°C' if units == 'celsius' else '72°F',
'condition': 'Partly cloudy',
'humidity': '65%'
}
return json.dumps(weather_data)
# Use the custom tool
tools = [WeatherTool()]
bot = Assistant(llm=llm_cfg, function_list=tools)
messages = [{'role': 'user', 'content': 'What\'s the weather in Tokyo?'}]
response = bot.run(messages=messages)
print(list(response)[-1])Qwen3 ਸੋਚਣ ਅਤੇ ਗੈਰ-ਸੋਚਣ ਮੋਡਾਂ ਦੇ ਵਿਚਕਾਰ ਡਾਇਨਾਮਿਕ ਸਵਿੱਚਿੰਗ ਦਾ ਸਮਰਥਨ ਕਰਦਾ ਹੈ:
# Enable thinking mode for complex reasoning
messages = [
{
'role': 'user',
'content': '/think Solve this complex math problem: If a train travels 120 km in 1.5 hours, and another train travels 200 km in 2.5 hours, which train is faster and by how much?'
}
]
# Disable thinking mode for simple queries
messages = [
{
'role': 'user',
'content': '/no_think What is the capital of France?'
}
]Qwen3 ਕਈ ਫੰਕਸ਼ਨ ਕਾਲਾਂ ਨੂੰ ਜੋੜਨ ਵਿੱਚ ਸ਼ਾਨਦਾਰ ਹੈ:
# Complex workflow example
messages = [
{
'role': 'user',
'content': '''
I need to prepare for a business meeting:
1. Check my calendar for conflicts tomorrow
2. Get weather forecast for the meeting location (San Francisco)
3. Find recent news about the client company (TechCorp)
4. Calculate travel time from my office to their headquarters
'''
}
]
# Qwen3 will automatically determine the sequence of function calls neededMicrosoft ਦਾ Foundry Local OpenAI-ਅਨੁਕੂਲ API ਪ੍ਰਦਾਨ ਕਰਦਾ ਹੈ ਜੋ ਮਾਡਲਾਂ ਨੂੰ ਸਥਾਨਕ ਤੌਰ 'ਤੇ ਚਲਾਉਣ ਲਈ ਵਧੇਰੇ ਗੋਪਨੀਯਤਾ ਅਤੇ ਪ੍ਰਦਰਸ਼ਨ ਦੇ ਨਾਲ ਹੈ।
Foundry Local ਰਿਲੀਜ਼ ਪੇਜ ਤੋਂ ਇੰਸਟਾਲਰ ਡਾਊਨਲੋਡ ਕਰੋ ਅਤੇ ਇੰਸਟਾਲੇਸ਼ਨ ਨਿਰਦੇਸ਼ਾਂ ਦੀ ਪਾਲਣਾ ਕਰੋ।
brew tap microsoft/foundrylocal
brew install foundrylocalimport openai
from foundry_local import FoundryLocalManager
# Initialize with model alias
alias = "phi-3.5-mini" # Or any supported model
manager = FoundryLocalManager(alias)
# Create OpenAI client pointing to local endpoint
client = openai.OpenAI(
base_url=manager.endpoint,
api_key=manager.api_key
)
# Define functions for the model
functions = [
{
"name": "calculate_tax",
"description": "Calculate tax amount based on income and rate",
"parameters": {
"type": "object",
"properties": {
"income": {
"type": "number",
"description": "Annual income amount"
},
"tax_rate": {
"type": "number",
"description": "Tax rate as decimal (e.g., 0.25 for 25%)"
}
},
"required": ["income", "tax_rate"]
}
}
]
# Make function calling request
response = client.chat.completions.create(
model=manager.model_info.id,
messages=[
{
"role": "user",
"content": "Calculate the tax for someone earning $75,000 with a 22% tax rate"
}
],
functions=functions,
function_call="auto"
)
print(response.choices[0].message.content)# List available models
foundry model list
# Download specific model
foundry model download phi-3.5-mini
# Run model interactively
foundry model run phi-3.5-mini
# Remove model from cache
foundry model remove phi-3.5-mini
# Delete all cached models
foundry model remove "*"Foundry Local ਤੁਹਾਡੇ ਹਾਰਡਵੇਅਰ ਲਈ ਸਭ ਤੋਂ ਵਧੀਆ ਮਾਡਲ ਵੈਰੀਐਂਟ ਨੂੰ ਸਵੈਚਾਲਿਤ ਤੌਰ 'ਤੇ ਚੁਣਦਾ ਹੈ:
- CUDA GPU: GPU-ਅਨੁਕੂਲ ਮਾਡਲ ਡਾਊਨਲੋਡ ਕਰਦਾ ਹੈ
- Qualcomm NPU: NPU-ਤੇਜ਼ ਮਾਡਲ ਵਰਤਦਾ ਹੈ
- ਸਿਰਫ਼ CPU: CPU-ਅਨੁਕੂਲ ਮਾਡਲ ਚੁਣਦਾ ਹੈ
# Good
{
"name": "get_stock_price",
"description": "Retrieve current stock price for a given symbol"
}
# Avoid
{
"name": "get_data",
"description": "Gets data"
}{
"name": "send_email",
"description": "Send an email message to specified recipients",
"parameters": {
"to": {
"type": "array",
"items": {"type": "string"},
"description": "List of recipient email addresses",
"required": True
},
"subject": {
"type": "string",
"description": "Email subject line",
"required": True
},
"body": {
"type": "string",
"description": "Email message content",
"required": True
},
"priority": {
"type": "string",
"enum": ["low", "normal", "high"],
"description": "Email priority level",
"default": "normal",
"required": False
}
}
}def execute_function(function_name, parameters):
try:
# Validate required parameters
if function_name == "send_email":
if not parameters.get("to") or not parameters.get("subject"):
return {"error": "Missing required parameters: to, subject"}
# Validate email format
email_pattern = r'^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$'
for email in parameters["to"]:
if not re.match(email_pattern, email):
return {"error": f"Invalid email format: {email}"}
# Execute function logic
result = perform_actual_function(function_name, parameters)
return {"success": True, "data": result}
except Exception as e:
return {"error": str(e)}ਲੱਛਣ: ਮਾਡਲ ਟੈਕਸਟ ਨਾਲ ਜਵਾਬ ਦਿੰਦਾ ਹੈ ਬਜਾਏ ਫੰਕਸ਼ਨ ਕਾਲ ਕਰਨ ਦੇ
ਹੱਲ:
- ਫੰਕਸ਼ਨ ਵੇਰਵਾ ਦੀ ਜਾਂਚ ਕਰੋ: ਯਕੀਨੀ ਬਣਾਓ ਕਿ ਇਹ ਵਰਤੋਂਕਾਰ ਦੇ ਇਰਾਦੇ ਨਾਲ ਸਪਸ਼ਟ ਤੌਰ 'ਤੇ ਮੇਲ ਖਾਂਦਾ ਹੈ
- ਪੈਰਾਮੀਟਰ ਪਰਿਭਾਸ਼ਾਵਾਂ ਦੀ ਪੁਸ਼ਟੀ ਕਰੋ: ਯਕੀਨੀ ਬਣਾਓ ਕਿ ਸਾਰੇ ਲੋੜੀਂਦੇ ਪੈਰਾਮੀਟਰ ਸਹੀ ਤੌਰ 'ਤੇ ਪਰਿਭਾਸ਼ਿਤ ਹਨ
- ਸਿਸਟਮ ਪ੍ਰੋੰਪਟ ਦੀ ਸਮੀਖਿਆ ਕਰੋ: ਸਪਸ਼ਟ ਨਿਰਦੇਸ਼ ਸ਼ਾਮਲ ਕਰੋ ਕਿ ਕਦੋਂ ਫੰਕਸ਼ਨ ਦੀ ਵਰਤੋਂ ਕਰਨੀ ਹੈ
- ਸਪਸ਼ਟ ਬੇਨਤੀਆਂ ਨਾਲ ਟੈਸਟ ਕਰੋ: "ਕਿਰਪਾ ਕਰਕੇ ਮੌਸਮ ਫੰਕਸ਼ਨ ਦੀ ਵਰਤੋਂ ਕਰਕੇ ਲੰਡਨ ਲਈ ਡਾਟਾ ਪ੍ਰਾਪਤ ਕਰੋ" ਵਰਗੇ ਟੈਸਟ ਕਰੋ
ਲੱਛਣ: ਫੰਕਸ਼ਨ ਗਲਤ ਜਾਂ ਗੁੰਮ ਪੈਰਾਮੀਟਰਾਂ ਨਾਲ ਕਾਲ ਕੀਤਾ ਜਾਂਦਾ ਹੈ
ਹੱਲ:
- ਪੈਰਾਮੀਟਰ ਉਦਾਹਰਨ ਸ਼ਾਮਲ ਕਰੋ: ਪੈਰਾਮੀਟਰ ਵੇਰਵਿਆਂ ਵਿੱਚ ਨਮੂਨਾ ਮੁੱਲ ਸ਼ਾਮਲ ਕਰੋ
- ਐਨਮ ਸੀਮਾਵਾਂ ਦੀ ਵਰਤੋਂ ਕਰੋ: ਜਦੋਂ ਸੰਭਵ ਹੋਵੇ ਤਾਂ ਪੈਰਾਮੀਟਰ ਮੁੱਲਾਂ ਨੂੰ ਵਿਸ਼ੇਸ਼ ਵਿਕਲਪਾਂ ਤੱਕ ਸੀਮਿਤ ਕਰੋ
- ਫਾਲਬੈਕ ਮੁੱਲ ਲਾਗੂ ਕਰੋ: ਵਿਕਲਪਿਕ ਪੈਰਾਮੀਟਰਾਂ ਲਈ ਸਮਝਦਾਰ ਡਿਫਾਲਟ ਪ੍ਰਦਾਨ ਕਰੋ
{
"name": "book_restaurant",
"parameters": {
"cuisine": {
"type": "string",
"enum": ["italian", "chinese", "mexican", "american", "french"],
"description": "Type of cuisine (example: 'italian' for Italian food)"
},
"party_size": {
"type": "integer",
"minimum": 1,
"maximum": 20,
"description": "Number of people (example: 4 for a family of four)"
}
}
}ਲੱਛਣ: ਜਦੋਂ ਕਈ ਫੰਕਸ਼ਨ ਚਲਾਉਣੇ ਚਾਹੀਦੇ ਹਨ, ਸਿਰਫ਼ ਇੱਕ ਚਲਦਾ ਹੈ
ਹੱਲ:
- ਮਾਡਲ ਸਮਰਥਨ ਦੀ ਜਾਂਚ ਕਰੋ: ਯਕੀਨੀ ਬਣਾਓ ਕਿ ਤੁਹਾਡਾ ਮਾਡਲ ਸਮਾਂਤਰ ਫੰਕਸ਼ਨ ਕਾਲਿੰਗ ਦਾ ਸਮਰਥਨ ਕਰਦਾ ਹੈ
- ਸਿਸਟਮ ਪ੍ਰੋੰਪਟ ਅਪਡੇਟ ਕਰੋ: ਸਿਸਟਮ ਸੁਨੇਹੇ ਵਿੱਚ "ਕੁਝ ਟੂਲ" ਜਾਂ "ਕਈ ਟੂਲ" ਸ਼ਾਮਲ ਕਰੋ
- ਉਚਿਤ ਮਾਡਲ ਵਰਜਨ ਦੀ ਵਰਤੋਂ ਕਰੋ: Ollama ਲਈ Phi-4-mini:3.8b-fp16 ਦੀ ਸਿਫਾਰਸ਼ ਕੀਤੀ ਗਈ ਹੈ
ਲੱਛਣ: ਡਿਫਾਲਟ Ollama ਸੈਟ ਮਾਫ ਕਰਨਾ, ਕਿਰਪਾ ਕਰਕੇ ਮੈਨੂੰ ਅਸਲ ਟੈਕਸਟ ਦਿਓ ਜੋ ਤਰਜਮਾ ਕਰਨਾ ਹੈ। """ਕੰਪ੍ਰੀਹੈਂਸਿਵ ਐਰਰ ਹੈਂਡਲਿੰਗ ਅਤੇ ਲੌਗਿੰਗ ਨਾਲ ਇੱਕ ਫੰਕਸ਼ਨ ਚਲਾਓ""" start_time = datetime.now()
try: # ਯਕੀਨੀ ਬਣਾਓ ਕਿ ਫੰਕਸ਼ਨ ਮੌਜੂਦ ਹੈ if function_name not in self.functions: return FunctionResult( success=False, error=f"Function '{function_name}' not found", timestamp=start_time )
# ਰੇਟ ਲਿਮਿਟ ਚੈੱਕ ਕਰੋ
if not self._check_rate_limit(function_name):
return FunctionResult(
success=False,
error=f"Rate limit exceeded for function '{function_name}'",
timestamp=start_time
)
# ਪੈਰਾਮੀਟਰਾਂ ਦੀ ਪੁਸ਼ਟੀ ਕਰੋ
validation_result = self._validate_parameters(function_name, parameters)
if not validation_result.success:
return validation_result
# ਫੰਕਸ਼ਨ ਚਲਾਓ
func_info = self.functions[function_name]
handler = func_info['handler']
if asyncio.iscoroutinefunction(handler):
result_data = await handler(**parameters)
else:
result_data = handler(**parameters)
execution_time = (datetime.now() - start_time).total_seconds()
result = FunctionResult(
success=True,
data=result_data,
execution_time=execution_time,
timestamp=start_time
)
# ਸਫਲਤਾਪੂਰਵਕ ਚਲਾਉਣ ਦੀ ਲੌਗਿੰਗ ਕਰੋ
self._log_function_call(function_name, parameters, result)
return result
except Exception as e: execution_time = (datetime.now() - start_time).total_seconds() result = FunctionResult( success=False, error=str(e), execution_time=execution_time, timestamp=start_time )
# ਫੇਲ੍ਹ ਚਲਾਉਣ ਦੀ ਲੌਗਿੰਗ ਕਰੋ
self._log_function_call(function_name, parameters, result)
return result
def _check_rate_limit(self, function_name: str) -> bool: """ਜਾਂਚ ਕਰੋ ਕਿ ਫੰਕਸ਼ਨ ਕਾਲ ਰੇਟ ਲਿਮਿਟ ਦੇ ਅੰਦਰ ਹੈ""" func_info = self.functions[function_name] now = datetime.now()
# ਜੇਕਰ ਇੱਕ ਮਿੰਟ ਬੀਤ ਗਿਆ ਹੈ ਤਾਂ ਕਾਊਂਟਰ ਰੀਸੈਟ ਕਰੋ
if (now - func_info['last_reset']).seconds >= 60:
func_info['call_count'] = 0
func_info['last_reset'] = now
# ਜਾਂਚ ਕਰੋ ਕਿ ਲਿਮਿਟ ਦੇ ਅੰਦਰ ਹੈ
if func_info['call_count'] >= func_info['rate_limit']:
return False
func_info['call_count'] += 1
return True
def _validate_parameters(self, function_name: str, parameters: Dict) -> FunctionResult: """ਫੰਕਸ਼ਨ ਪੈਰਾਮੀਟਰਾਂ ਦੀ ਪੁਸ਼ਟੀ ਕਰੋ""" func_params = self.functions[function_name]['parameters']
# ਲੋੜੀਂਦੇ ਪੈਰਾਮੀਟਰਾਂ ਦੀ ਜਾਂਚ ਕਰੋ
for param_name, param_info in func_params.items():
if param_info.get('required', False) and param_name not in parameters:
return FunctionResult(
success=False,
error=f"Missing required parameter: {param_name}"
)
# ਪੈਰਾਮੀਟਰਾਂ ਦੇ ਟਾਈਪ ਅਤੇ ਰੋਕਾਂ ਦੀ ਪੁਸ਼ਟੀ ਕਰੋ
for param_name, value in parameters.items():
if param_name in func_params:
param_info = func_params[param_name]
# ਟਾਈਪ ਵੈਰੀਫਿਕੇਸ਼ਨ
expected_type = param_info.get('type')
if expected_type == 'string' and not isinstance(value, str):
return FunctionResult(
success=False,
error=f"Parameter '{param_name}' must be a string"
)
elif expected_type == 'number' and not isinstance(value, (int, float)):
return FunctionResult(
success=False,
error=f"Parameter '{param_name}' must be a number"
)
elif expected_type == 'boolean' and not isinstance(value, bool):
return FunctionResult(
success=False,
error=f"Parameter '{param_name}' must be a boolean"
)
# ਐਨਮ ਵੈਰੀਫਿਕੇਸ਼ਨ
if 'enum' in param_info and value not in param_info['enum']:
return FunctionResult(
success=False,
error=f"Parameter '{param_name}' must be one of: {param_info['enum']}"
)
return FunctionResult(success=True)
def _log_function_call(self, function_name: str, parameters: Dict, result: FunctionResult): """ਆਡਿਟ ਦੇ ਮਕਸਦ ਲਈ ਫੰਕਸ਼ਨ ਕਾਲ ਲੌਗ ਕਰੋ""" log_entry = { 'timestamp': result.timestamp.isoformat(), 'function_name': function_name, 'parameters': parameters, 'success': result.success, 'execution_time': result.execution_time, 'error': result.error if not result.success else None }
self.audit_log.append(log_entry)
# ਬਾਹਰੀ ਲੌਗਿੰਗ ਸਿਸਟਮ ਵਿੱਚ ਲਿਖਣ ਲਈ ਵਿਕਲਪਿਕ
if self.config.get('enable_external_logging', False):
self._write_to_external_log(log_entry)
def _write_to_external_log(self, log_entry: Dict): """ਬਾਹਰੀ ਲੌਗਿੰਗ ਸਿਸਟਮ ਵਿੱਚ ਲੌਗ ਐਂਟਰੀ ਲਿਖੋ""" # ਇੰਪਲੀਮੈਂਟੇਸ਼ਨ ਤੁਹਾਡੇ ਲੌਗਿੰਗ ਇੰਫਰਾਸਟਰਕਚਰ 'ਤੇ ਨਿਰਭਰ ਕਰੇਗੀ # ਜਿਵੇਂ ਕਿ ELK ਸਟੈਕ, CloudWatch, ਆਦਿ ਨੂੰ ਭੇਜੋ। pass
async def _get_customer_info(self, customer_id: str, include_history: bool = False) -> Dict: """CRM ਸਿਸਟਮ ਤੋਂ ਗਾਹਕ ਦੀ ਜਾਣਕਾਰੀ ਪ੍ਰਾਪਤ ਕਰੋ""" # ਡਾਟਾਬੇਸ/API ਕਾਲ ਦਾ ਨਕਲ ਕਰੋ await asyncio.sleep(0.1) # ਨੈਟਵਰਕ ਡਿਲੇ ਦਾ ਨਕਲ
customer_data = {
'customer_id': customer_id,
'name': 'John Doe',
'email': 'john.doe@example.com',
'phone': '+1-555-0123',
'status': 'active',
'tier': 'premium'
}
if include_history:
customer_data['purchase_history'] = [
{'date': '2024-01-15', 'product': 'Product A', 'amount': 1500},
{'date': '2024-03-22', 'product': 'Product B', 'amount': 2300}
]
return customer_data
async def _create_sales_opportunity(self, customer_id: str, product_id: str, estimated_value: float, expected_close_date: str) -> Dict: """ਨਵੀਂ ਵਿਕਰੀ ਮੌਕਾ ਬਣਾਓ""" # CRM API ਕਾਲ ਦਾ ਨਕਲ ਕਰੋ await asyncio.sleep(0.2)
opportunity_id = f"OPP-{datetime.now().strftime('%Y%m%d%H%M%S')}"
return {
'opportunity_id': opportunity_id,
'customer_id': customer_id,
'product_id': product_id,
'estimated_value': estimated_value,
'expected_close_date': expected_close_date,
'status': 'open',
'created_date': datetime.now().isoformat()
}
async def _generate_sales_report(self, period: str, region: str = None, product_category: str = None) -> Dict: """ਵਿਆਪਕ ਵਿਕਰੀ ਰਿਪੋਰਟ ਬਣਾਓ""" # ਡਾਟਾ ਐਗਰੀਗੇਸ਼ਨ ਦਾ ਨਕਲ ਕਰੋ await asyncio.sleep(0.5)
return {
'report_id': f"RPT-{datetime.now().strftime('%Y%m%d%H%M%S')}",
'period': period,
'region': region,
'product_category': product_category,
'total_sales': 125000.00,
'total_opportunities': 45,
'conversion_rate': 0.67,
'top_products': [
{'product_id': 'PROD-001', 'sales': 45000},
{'product_id': 'PROD-002', 'sales': 32000}
],
'generated_at': datetime.now().isoformat()
}
async def _send_notification(self, recipients: List[str], message: str, priority: str = 'medium', channel: str = 'email') -> Dict: """ਨਿਰਧਾਰਿਤ ਚੈਨਲ ਦੁਆਰਾ ਸੂਚਨਾ ਭੇਜੋ""" # ਨੋਟੀਫਿਕੇਸ਼ਨ ਸੇਵਾ ਕਾਲ ਦਾ ਨਕਲ ਕਰੋ await asyncio.sleep(0.1)
notification_id = f"NOTIF-{datetime.now().strftime('%Y%m%d%H%M%S')}"
return {
'notification_id': notification_id,
'recipients': recipients,
'channel': channel,
'priority': priority,
'status': 'sent',
'sent_at': datetime.now().isoformat()
}
def get_function_definitions(self) -> List[Dict]: """ਸਾਰੇ ਰਜਿਸਟਰਡ ਫੰਕਸ਼ਨਾਂ ਲਈ OpenAI-ਅਨੁਕੂਲ ਫੰਕਸ਼ਨ ਡਿਫਿਨੀਸ਼ਨ ਪ੍ਰਾਪਤ ਕਰੋ""" definitions = []
for func_name, func_info in self.functions.items():
definition = {
'name': func_name,
'description': func_info['description'],
'parameters': {
'type': 'object',
'properties': {},
'required': []
}
}
for param_name, param_info in func_info['parameters'].items():
definition['parameters']['properties'][param_name] = {
'type': param_info['type'],
'description': param_info.get('description', '')
}
if 'enum' in param_info:
definition['parameters']['properties'][param_name]['enum'] = param_info['enum']
if 'default' in param_info:
definition['parameters']['properties'][param_name]['default'] = param_info['default']
if param_info.get('required', False):
definition['parameters']['required'].append(param_name)
definitions.append(definition)
return definitions
async def enterprise_demo(): """ਐਨਟਰਪ੍ਰਾਈਜ਼ AI ਏਜੰਟ ਦੀ ਸਮਰੱਥਾ ਦਿਖਾਓ"""
config = {
'enable_external_logging': True,
'max_concurrent_functions': 10,
'default_timeout': 30
}
agent = EnterpriseAIAgent(config)
# ਉਦਾਹਰਣ 1: ਗਾਹਕ ਦੀ ਪੁੱਛਗਿੱਛ ਪ੍ਰੋਸੈਸਿੰਗ
print("=== ਗਾਹਕ ਦੀ ਪੁੱਛਗਿੱਛ ਪ੍ਰੋਸੈਸਿੰਗ ===")
# ਗਾਹਕ ਦੀ ਜਾਣਕਾਰੀ ਪ੍ਰਾਪਤ ਕਰੋ
result = await agent.execute_function(
'get_customer_info',
{'customer_id': 'CUST-12345', 'include_history': True}
)
if result.success:
print(f"ਗਾਹਕ ਦੀ ਜਾਣਕਾਰੀ ਪ੍ਰਾਪਤ ਕੀਤੀ: {result.data['name']}")
print(f"ਚਲਾਉਣ ਦਾ ਸਮਾਂ: {result.execution_time:.3f}s")
# ਉਦਾਹਰਣ 2: ਵਿਕਰੀ ਮੌਕਾ ਬਣਾਉਣਾ
print("\n=== ਵਿਕਰੀ ਮੌਕਾ ਬਣਾਉਣਾ ===")
result = await agent.execute_function(
'create_sales_opportunity',
{
'customer_id': 'CUST-12345',
'product_id': 'PROD-001',
'estimated_value': 15000.0,
'expected_close_date': '2025-09-30'
}
)
if result.success:
print(f"ਮੌਕਾ ਬਣਾਇਆ ਗਿਆ: {result.data['opportunity_id']}")
# ਉਦਾਹਰਣ 3: ਬੈਚ ਓਪਰੇਸ਼ਨ
print("\n=== ਬੈਚ ਓਪਰੇਸ਼ਨ ===")
tasks = [
agent.execute_function('generate_sales_report', {'period': 'monthly'}),
agent.execute_function('send_notification', {
'recipients': ['manager@company.com'],
'message': 'ਨਵਾਂ ਮੌਕਾ ਬਣਾਇਆ ਗਿਆ',
'priority': 'high',
'channel': 'email'
})
]
results = await asyncio.gather(*tasks)
for i, result in enumerate(results):
if result.success:
print(f"ਟਾਸਕ {i+1} ਸਫਲਤਾਪੂਰਵਕ ਪੂਰਾ ਹੋਇਆ")
else:
print(f"ਟਾਸਕ {i+1} ਫੇਲ੍ਹ ਹੋਇਆ: {result.error}")
# ਆਡਿਟ ਲੌਗ ਦਿਖਾਓ
print(f"\n=== ਆਡਿਟ ਲੌਗ ({len(agent.audit_log)} ਐਂਟਰੀਆਂ) ===")
for entry in agent.audit_log[-3:]: # ਆਖਰੀ 3 ਐਂਟਰੀਆਂ ਦਿਖਾਓ
print(f"{entry['timestamp']}: {entry['function_name']} - {'SUCCESS' if entry['success'] else 'FAILED'}")
- ਫਾਈ-4 ਮਾਡਲ: ਹੱਗਿੰਗ ਫੇਸ ਕਲੈਕਸ਼ਨ
- ਕਵੈਨ3 ਦਸਤਾਵੇਜ਼: ਅਧਿਕਾਰਕ ਕਵੈਨ ਦਸਤਾਵੇਜ਼
- ਓਲਾਮਾ: ਅਧਿਕਾਰਕ ਵੈਬਸਾਈਟ
- ਫਾਊਂਡਰੀ ਲੋਕਲ: GitHub ਰਿਪੋਜ਼ਟਰੀ
- ਫੰਕਸ਼ਨ ਕਾਲਿੰਗ ਬਿਹਤਰ ਤਰੀਕੇ: ਹੱਗਿੰਗ ਫੇਸ ਗਾਈਡ
ਯਾਦ ਰੱਖੋ ਕਿ ਫੰਕਸ਼ਨ ਕਾਲਿੰਗ ਇੱਕ ਵਿਕਾਸਸ਼ੀਲ ਖੇਤਰ ਹੈ, ਅਤੇ ਆਪਣੇ ਚੁਣੇ ਹੋਏ ਫਰੇਮਵਰਕ ਅਤੇ ਮਾਡਲ ਵਿੱਚ ਨਵੀਂ ਤਰੱਕੀਆਂ ਨਾਲ ਅਪਡੇਟ ਰਹਿਣਾ ਤੁਹਾਨੂੰ ਹੋਰ ਪ੍ਰਭਾਵਸ਼ਾਲੀ AI ਏਜੰਟ ਬਣਾਉਣ ਵਿੱਚ ਮਦਦ ਕਰੇਗਾ।
ਅਸਵੀਕਤੀ:
ਇਹ ਦਸਤਾਵੇਜ਼ AI ਅਨੁਵਾਦ ਸੇਵਾ Co-op Translator ਦੀ ਵਰਤੋਂ ਕਰਕੇ ਅਨੁਵਾਦ ਕੀਤਾ ਗਿਆ ਹੈ। ਜਦੋਂ ਕਿ ਅਸੀਂ ਸਹੀਤਾ ਲਈ ਯਤਨਸ਼ੀਲ ਹਾਂ, ਕਿਰਪਾ ਕਰਕੇ ਧਿਆਨ ਦਿਓ ਕਿ ਸਵੈਚਾਲਿਤ ਅਨੁਵਾਦਾਂ ਵਿੱਚ ਗਲਤੀਆਂ ਜਾਂ ਅਸੁਚੱਜੇਪਣ ਹੋ ਸਕਦੇ ਹਨ। ਮੂਲ ਦਸਤਾਵੇਜ਼ ਨੂੰ ਇਸਦੀ ਮੂਲ ਭਾਸ਼ਾ ਵਿੱਚ ਅਧਿਕਾਰਤ ਸਰੋਤ ਮੰਨਿਆ ਜਾਣਾ ਚਾਹੀਦਾ ਹੈ। ਮਹੱਤਵਪੂਰਨ ਜਾਣਕਾਰੀ ਲਈ, ਪੇਸ਼ੇਵਰ ਮਨੁੱਖੀ ਅਨੁਵਾਦ ਦੀ ਸਿਫਾਰਸ਼ ਕੀਤੀ ਜਾਂਦੀ ਹੈ। ਇਸ ਅਨੁਵਾਦ ਦੀ ਵਰਤੋਂ ਤੋਂ ਪੈਦਾ ਹੋਣ ਵਾਲੇ ਕਿਸੇ ਵੀ ਗਲਤਫਹਿਮੀ ਜਾਂ ਗਲਤ ਵਿਆਖਿਆ ਲਈ ਅਸੀਂ ਜ਼ਿੰਮੇਵਾਰ ਨਹੀਂ ਹਾਂ।