Shannon இடைமுகம் ஏற்றப்படுகிறது...
OpenAI மற்றும் Anthropic இணக்கமான AI API: function calling, web search, structured outputs உடன்.
Shannon இன் OpenAI மற்றும் Anthropic இணக்கமான API மூலம் வெளியிட தேவையான அனைத்தும்.
https://us-central1-shannonai.cloudfunctions.net/v1/chat/completionsChat Completions API ஐ function calling மற்றும் streaming உடன் பயன்படுத்தவும்.
https://us-central1-shannonai.cloudfunctions.net/v1/messagesClaude Messages வடிவம், கருவிகள் மற்றும் anthropic-version header உடன்.
Authorization: Bearer <api-key>அல்லது Claude style அழைப்புகளுக்கு X-API-Key மற்றும் anthropic-version.
பொது ஆவணம் - அழைக்க key தேவைஸ்ட்ரீமிங், function calling, structured outputs, web search.
OpenAI மற்றும் Anthropic API களுக்கான drop-in மாற்றம்; கருவிகள், structured outputs, மற்றும் உள்ளமைந்த web search ஆதரவு.
OpenAI மற்றும் Anthropic SDK களுடன் வேலை செய்கிறது. base URL ஐ மாற்றினால் போதும்.
கருவிகளை வரையறுக்கவும், Shannon அவற்றை அழைக்க அனுமதிக்கவும். auto, forced, none முறைகள் ஆதரிக்கப்படுகின்றன.
மூலக் குறிப்புகளுடன் நேரடி web search. தானாக கிடைக்கும்.
நம்பத்தகுந்த தரவு எடுப்புக்கு JSON mode மற்றும் JSON Schema கட்டாயப்படுத்தல்.
தானியங்கி function execution loops. ஒவ்வொரு கோரிக்கைக்கும் 10 iteration வரை.
Server-sent events மூலம் real-time token streaming.
மூன்று படிகளில் தொடங்குங்கள். Shannon OpenAI மற்றும் Anthropic clients-ஐ பிரதிபலிக்கிறது.
OpenAI-இணக்கமான endpoint ஐ பயன்படுத்தவும்.
https://us-central1-shannonai.cloudfunctions.net/v1/chat/completionsAuthorization header இல் Bearer auth பயன்படுத்தவும்.
ஒரு மொழியைத் தேர்ந்தெடுத்து உங்கள் key ஐ மாற்றவும்.
from openai import OpenAIclient = OpenAI(api_key="YOUR_API_KEY",base_url="https://us-central1-shannonai.cloudfunctions.net/v1")response = client.chat.completions.create(model="shannon-balanced-grpo",messages=[{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "Hello, Shannon!"}],max_tokens=1024)print(response.choices[0].message.content)
{
"id": "chatcmpl-abc123",
"object": "chat.completion",
"created": 1234567890,
"model": "shannon-balanced-grpo",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Hello! I'm Shannon, your AI assistant. How can I help you today?"
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 25,
"completion_tokens": 18,
"total_tokens": 43
}
}Shannon API ஐ உலாவியில் நேரடியாகச் சோதிக்கவும். உங்கள் கோரிக்கையை உருவாக்கி, இயக்கி, நேரடியாக பதிலைப் பாருங்கள்.
Switch between Chat Completions, Responses, and Messages without changing pages. The request body, auth header, stream parser, and SDK snippets all follow the selected protocol.
Pick an endpoint, shape the payload, and run the request to inspect the live output.
{"model": "shannon-balanced-grpo","messages": [{"role": "system","content": "You are Shannon. Answer crisply, commercially, and with strong structure."},{"role": "user","content": "Outline a clean launch plan for a new AI API aimed at startup founders."}],"max_tokens": 1024,"temperature": 0.7,"stream": true}
அனைத்து API கோரிக்கைகளுக்கும் உங்கள் Shannon API விசையைப் பயன்படுத்தி அங்கீகாரம் தேவை.
Authorization: Bearer YOUR_API_KEY
X-API-Key: YOUR_API_KEYanthropic-version: 2023-06-01
Shannon பல்வேறு பயன்பாடுகளுக்காக மொழிகளைக் கொண்ட பல மாடல்களை வழங்குகிறது.
shannon-balanced-grpoBalancedதினசரி பணிகளுக்கான வேகமான மற்றும் திறமையான பதில்கள்
shannon-deep-dapoDeepசிக்கலான பிரச்சினைகளுக்கு மேம்பட்ட reasoning
shannon-coder-1CoderClaude Code CLI க்காக call-based quota உடன் மேம்படுத்தப்பட்டது
Shannon அழைக்கக்கூடிய கருவிகளை வரையறுக்கவும்; செயல்கள் அல்லது தகவல்களை பெற உதவும்.
from openai import OpenAIimport jsonclient = OpenAI(api_key="YOUR_API_KEY",base_url="https://us-central1-shannonai.cloudfunctions.net/v1")# Define available tools/functionstools = [{"type": "function","function": {"name": "get_weather","description": "Get current weather for a location","parameters": {"type": "object","properties": {"location": {"type": "string","description": "City name, e.g., 'Tokyo'"},"unit": {"type": "string","enum": ["celsius", "fahrenheit"]}},"required": ["location"]}}}]response = client.chat.completions.create(model="shannon-balanced-grpo",messages=[{"role": "user", "content": "What's the weather in Tokyo?"}],tools=tools,tool_choice="auto")# Check if model wants to call a functionif response.choices[0].message.tool_calls:tool_call = response.choices[0].message.tool_calls[0]print(f"Function: {tool_call.function.name}")print(f"Arguments: {tool_call.function.arguments}")
{
"id": "chatcmpl-xyz",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": null,
"tool_calls": [
{
"id": "call_abc123",
"type": "function",
"function": {
"name": "get_weather",
"arguments": "{\"location\": \"Tokyo\", \"unit\": \"celsius\"}"
}
}
]
},
"finish_reason": "tool_calls"
}
]
}உங்கள் schema-க்கு பொருந்தும் சரியான JSON திருப்ப Shannon-ஐ கட்டாயப்படுத்தவும்.
from openai import OpenAIclient = OpenAI(api_key="YOUR_API_KEY",base_url="https://us-central1-shannonai.cloudfunctions.net/v1")# Force JSON output with schemaresponse = client.chat.completions.create(model="shannon-balanced-grpo",messages=[{"role": "user", "content": "Extract: John Doe, 30 years old, engineer"}],response_format={"type": "json_schema","json_schema": {"name": "person_info","schema": {"type": "object","properties": {"name": {"type": "string"},"age": {"type": "integer"},"occupation": {"type": "string"}},"required": ["name", "age", "occupation"]}}})import jsondata = json.loads(response.choices[0].message.content)print(data) # {"name": "John Doe", "age": 30, "occupation": "engineer"}
பதிலளிக்கும் UI க்கு Server-Sent Events மூலம் real-time token streaming ஐ இயக்கவும்.
from openai import OpenAIclient = OpenAI(api_key="YOUR_API_KEY",base_url="https://us-central1-shannonai.cloudfunctions.net/v1")# Enable streaming for real-time responsesstream = client.chat.completions.create(model="shannon-balanced-grpo",messages=[{"role": "user", "content": "Write a short poem about AI"}],stream=True)for chunk in stream:if chunk.choices[0].delta.content:print(chunk.choices[0].delta.content, end="", flush=True)
Shannon தானாக கிடைக்கும் web_search function ஐ கொண்டுள்ளது.
from openai import OpenAIclient = OpenAI(api_key="YOUR_API_KEY",base_url="https://us-central1-shannonai.cloudfunctions.net/v1")# Web search is automatically available!# Shannon will use it when needed for current informationresponse = client.chat.completions.create(model="shannon-balanced-grpo",messages=[{"role": "user", "content": "What are the latest AI news today?"}],# Optionally, explicitly define web_search tooltools=[{"type": "function","function": {"name": "web_search","description": "Search the web for current information","parameters": {"type": "object","properties": {"query": {"type": "string", "description": "Search query"}},"required": ["query"]}}}])print(response.choices[0].message.content)# Response includes sources and citations
Shannon Anthropic Messages API format-ஐயும் ஆதரிக்கிறது.
https://us-central1-shannonai.cloudfunctions.net/v1/messagesimport anthropicclient = anthropic.Anthropic(api_key="YOUR_API_KEY",base_url="https://us-central1-shannonai.cloudfunctions.net/messages")response = client.messages.create(model="shannon-balanced-grpo",max_tokens=1024,messages=[{"role": "user", "content": "Hello, Shannon!"}],# Tool use (Anthropic format)tools=[{"name": "web_search","description": "Search the web","input_schema": {"type": "object","properties": {"query": {"type": "string"}},"required": ["query"]}}])print(response.content[0].text)
எந்த OpenAI அல்லது Anthropic SDK யையும் பயன்படுத்தலாம் — base URL ஐ மாற்றினால் போதும்.
அதிகாரப்பூர்வ OpenAI Python SDK — Shannon உடன் வேலை செய்கிறது
pip install openaiஅதிகாரப்பூர்வ OpenAI Node.js SDK — Shannon உடன் வேலை செய்கிறது
npm install openaiOpenAI-இணக்கமான API க்கான சமுதாய Go client
go get github.com/sashabaranov/go-openaiOpenAI-இணக்கமான API க்கான சமுதாய PHP client
composer require openai-php/clientஅதிகாரப்பூர்வ Anthropic Python SDK — Shannon உடன் வேலை செய்கிறது
pip install anthropicஅதிகாரப்பூர்வ Anthropic TypeScript SDK — Shannon உடன் வேலை செய்கிறது
npm install @anthropic-ai/sdkShannon பரிசுத்தமான HTTP status codes பயன்படுத்தி விரிவான பிழை செய்திகள் திருப்புகிறது.
{
"error": {
"message": "Invalid API key provided",
"type": "authentication_error",
"code": "invalid_api_key"
}
}Shannon API இன் சமீபத்திய புதுப்பிப்புகள் மற்றும் மேம்பாடுகள்.
உங்கள் API விசையை பெற்று இன்று Shannon AI உடன் கட்டுங்கள்.